From: Shenghui Wang Date: Mon, 8 Oct 2018 12:41:19 +0000 (+0800) Subject: bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_alloc_set X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8792099f9ad487cf381f4e8199ff2158ba0f6eb5;p=linux.git bcache: use MAX_CACHES_PER_SET instead of magic number 8 in __bch_bucket_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 Signed-off-by: Coly Li Signed-off-by: Jens Axboe --- diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 7a28232d868bd..5002838ea4760 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -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);