Skip to content

Commit 63a96c0

Browse files
Coly Liaxboe
authored andcommitted
bcache: only use bucket_bytes() on struct cache
Because struct cache_set and struct cache both have struct cache_sb, macro bucket_bytes() currently are used on both of them. When removing the embedded struct cache_sb from struct cache_set, this macro won't be used on struct cache_set anymore. This patch unifies all bucket_bytes() usage only on struct cache, this is one of the preparation to remove the embedded struct cache_sb from struct cache_set. Signed-off-by: Coly Li <colyli@suse.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 3c4fae2 commit 63a96c0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/md/bcache/bcache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ struct bbio {
757757
#define btree_default_blocks(c) \
758758
((unsigned int) ((PAGE_SECTORS * (c)->btree_pages) >> (c)->block_bits))
759759

760-
#define bucket_bytes(c) ((c)->sb.bucket_size << 9)
760+
#define bucket_bytes(ca) ((ca)->sb.bucket_size << 9)
761761
#define block_bytes(ca) ((ca)->sb.block_size << 9)
762762

763763
static inline unsigned int meta_bucket_pages(struct cache_sb *sb)

‎drivers/md/bcache/sysfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ SHOW(__bch_cache_set)
713713

714714
sysfs_print(synchronous, CACHE_SYNC(&c->sb));
715715
sysfs_print(journal_delay_ms, c->journal_delay_ms);
716-
sysfs_hprint(bucket_size, bucket_bytes(c));
716+
sysfs_hprint(bucket_size, bucket_bytes(c->cache));
717717
sysfs_hprint(block_size, block_bytes(c->cache));
718718
sysfs_print(tree_depth, c->root->level);
719719
sysfs_print(root_usage_percent, bch_root_usage(c));

0 commit comments

Comments
 (0)