static int cache_mode_write(struct cgroup *cgrp, struct cftype *cft, const char *buf) { int v = bch_read_string_list(buf, bch_cache_modes); if (v < 0) return v; cgroup_to_bcache(cgrp)->cache_mode = v - 1; return 0; }
static ssize_t cache_mode_read(struct cgroup *cgrp, struct cftype *cft, struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) { char tmp[1024]; int len = bch_snprint_string_list(tmp, PAGE_SIZE, bch_cache_modes, cgroup_to_bcache(cgrp)->cache_mode + 1); if (len < 0) return len; return simple_read_from_buffer(buf, nbytes, ppos, tmp, len); }
static u64 bch_cache_misses_read(struct cgroup *cgrp, struct cftype *cft) { struct bch_cgroup *bcachecg = cgroup_to_bcache(cgrp); return atomic_read(&bcachecg->stats.cache_misses); }
static int bch_verify_write(struct cgroup *cgrp, struct cftype *cft, u64 val) { cgroup_to_bcache(cgrp)->verify = val; return 0; }
static u64 bch_verify_read(struct cgroup *cgrp, struct cftype *cft) { return cgroup_to_bcache(cgrp)->verify; }
static void bcachecg_destroy(struct cgroup *cgroup) { struct bch_cgroup *cg = cgroup_to_bcache(cgroup); free_css_id(&bcache_subsys, &cg->css); kfree(cg); }
static void bcachecg_destroy(struct cgroup *cgroup) { struct bch_cgroup *cg = cgroup_to_bcache(cgroup); kfree(cg); }