Merge branch 'for-3.11' of git://linux-nfs.org/~bfields/linux
[linux-2.6.git] / drivers / md / bcache / stats.h
blobc7c7a8fd29fe4ba1377420d1e7f51d4aa0c57d5c
1 #ifndef _BCACHE_STATS_H_
2 #define _BCACHE_STATS_H_
4 struct cache_stat_collector {
5 atomic_t cache_hits;
6 atomic_t cache_misses;
7 atomic_t cache_bypass_hits;
8 atomic_t cache_bypass_misses;
9 atomic_t cache_readaheads;
10 atomic_t cache_miss_collisions;
11 atomic_t sectors_bypassed;
14 struct cache_stats {
15 struct kobject kobj;
17 unsigned long cache_hits;
18 unsigned long cache_misses;
19 unsigned long cache_bypass_hits;
20 unsigned long cache_bypass_misses;
21 unsigned long cache_readaheads;
22 unsigned long cache_miss_collisions;
23 unsigned long sectors_bypassed;
25 unsigned rescale;
28 struct cache_accounting {
29 struct closure cl;
30 struct timer_list timer;
31 atomic_t closing;
33 struct cache_stat_collector collector;
35 struct cache_stats total;
36 struct cache_stats five_minute;
37 struct cache_stats hour;
38 struct cache_stats day;
41 struct search;
43 void bch_cache_accounting_init(struct cache_accounting *acc,
44 struct closure *parent);
46 int bch_cache_accounting_add_kobjs(struct cache_accounting *acc,
47 struct kobject *parent);
49 void bch_cache_accounting_clear(struct cache_accounting *acc);
51 void bch_cache_accounting_destroy(struct cache_accounting *acc);
53 void bch_mark_cache_accounting(struct search *s, bool hit, bool bypass);
54 void bch_mark_cache_readahead(struct search *s);
55 void bch_mark_cache_miss_collision(struct search *s);
56 void bch_mark_sectors_bypassed(struct search *s, int sectors);
58 #endif /* _BCACHE_STATS_H_ */