sysfs.c (63a96c05cd43ccf66cb671af039c7931a840efe8) sysfs.c (6f9414e0f6f35c7669dad5ac1a838ce323302f03)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * bcache sysfs interfaces
4 *
5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
6 * Copyright 2012 Google, Inc.
7 */
8

--- 697 unchanged lines hidden (view full) ---

706 ? div64_u64(c->gc_stats.data, c->gc_stats.nkeys)
707 : 0;
708}
709
710SHOW(__bch_cache_set)
711{
712 struct cache_set *c = container_of(kobj, struct cache_set, kobj);
713
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * bcache sysfs interfaces
4 *
5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com>
6 * Copyright 2012 Google, Inc.
7 */
8

--- 697 unchanged lines hidden (view full) ---

706 ? div64_u64(c->gc_stats.data, c->gc_stats.nkeys)
707 : 0;
708}
709
710SHOW(__bch_cache_set)
711{
712 struct cache_set *c = container_of(kobj, struct cache_set, kobj);
713
714 sysfs_print(synchronous, CACHE_SYNC(&c->sb));
714 sysfs_print(synchronous, CACHE_SYNC(&c->cache->sb));
715 sysfs_print(journal_delay_ms, c->journal_delay_ms);
716 sysfs_hprint(bucket_size, bucket_bytes(c->cache));
717 sysfs_hprint(block_size, block_bytes(c->cache));
718 sysfs_print(tree_depth, c->root->level);
719 sysfs_print(root_usage_percent, bch_root_usage(c));
720
721 sysfs_hprint(btree_cache_size, bch_cache_size(c));
722 sysfs_print(btree_cache_max_chain, bch_cache_max_chain(c));

--- 84 unchanged lines hidden (view full) ---

807 bch_cache_set_unregister(c);
808
809 if (attr == &sysfs_stop)
810 bch_cache_set_stop(c);
811
812 if (attr == &sysfs_synchronous) {
813 bool sync = strtoul_or_return(buf);
814
715 sysfs_print(journal_delay_ms, c->journal_delay_ms);
716 sysfs_hprint(bucket_size, bucket_bytes(c->cache));
717 sysfs_hprint(block_size, block_bytes(c->cache));
718 sysfs_print(tree_depth, c->root->level);
719 sysfs_print(root_usage_percent, bch_root_usage(c));
720
721 sysfs_hprint(btree_cache_size, bch_cache_size(c));
722 sysfs_print(btree_cache_max_chain, bch_cache_max_chain(c));

--- 84 unchanged lines hidden (view full) ---

807 bch_cache_set_unregister(c);
808
809 if (attr == &sysfs_stop)
810 bch_cache_set_stop(c);
811
812 if (attr == &sysfs_synchronous) {
813 bool sync = strtoul_or_return(buf);
814
815 if (sync != CACHE_SYNC(&c->sb)) {
816 SET_CACHE_SYNC(&c->sb, sync);
815 if (sync != CACHE_SYNC(&c->cache->sb)) {
816 SET_CACHE_SYNC(&c->cache->sb, sync);
817 bcache_write_super(c);
818 }
819 }
820
821 if (attr == &sysfs_flash_vol_create) {
822 int r;
823 uint64_t v;
824

--- 354 unchanged lines hidden ---
817 bcache_write_super(c);
818 }
819 }
820
821 if (attr == &sysfs_flash_vol_create) {
822 int r;
823 uint64_t v;
824

--- 354 unchanged lines hidden ---