Skip to content

Commit

Permalink
bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_buc…
Browse files Browse the repository at this point in the history
…ket_alloc_set

Current cache_set has MAX_CACHES_PER_SET caches most, and the macro
is used for
"
	struct cache *cache_by_alloc[MAX_CACHES_PER_SET];
"
in the define of struct cache_set.

Use MAX_CACHES_PER_SET instead of magic number 8 in
__bch_bucket_alloc_set.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Shenghui Wang authored and Jens Axboe committed Oct 8, 2018
1 parent 149d0ef commit 8792099
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/bcache/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,
int i;

lockdep_assert_held(&c->bucket_lock);
BUG_ON(!n || n > c->caches_loaded || n > 8);
BUG_ON(!n || n > c->caches_loaded || n > MAX_CACHES_PER_SET);

bkey_init(k);

Expand Down

0 comments on commit 8792099

Please sign in to comment.