#include "bcache.h"
#include "stats.h"
#include "btree.h"
#include "sysfs.h"
static const unsigned int DAY_RESCALE = …;
static const unsigned int HOUR_RESCALE = …;
static const unsigned int FIVE_MINUTE_RESCALE = …;
static const unsigned int accounting_delay = …;
static const unsigned int accounting_weight = …;
read_attribute(cache_hits);
read_attribute(cache_misses);
read_attribute(cache_bypass_hits);
read_attribute(cache_bypass_misses);
read_attribute(cache_hit_ratio);
read_attribute(cache_miss_collisions);
read_attribute(bypassed);
SHOW(bch_stats)
{ … }
STORE(bch_stats)
{ … }
static void bch_stats_release(struct kobject *k)
{ … }
static struct attribute *bch_stats_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static KTYPE(bch_stats);
int bch_cache_accounting_add_kobjs(struct cache_accounting *acc,
struct kobject *parent)
{ … }
void bch_cache_accounting_clear(struct cache_accounting *acc)
{ … }
void bch_cache_accounting_destroy(struct cache_accounting *acc)
{ … }
static void scale_stat(unsigned long *stat)
{ … }
static void scale_stats(struct cache_stats *stats, unsigned long rescale_at)
{ … }
static void scale_accounting(struct timer_list *t)
{ … }
static void mark_cache_stats(struct cache_stat_collector *stats,
bool hit, bool bypass)
{ … }
void bch_mark_cache_accounting(struct cache_set *c, struct bcache_device *d,
bool hit, bool bypass)
{ … }
void bch_mark_cache_miss_collision(struct cache_set *c, struct bcache_device *d)
{ … }
void bch_mark_sectors_bypassed(struct cache_set *c, struct cached_dev *dc,
int sectors)
{ … }
void bch_cache_accounting_init(struct cache_accounting *acc,
struct closure *parent)
{ … }