summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache
diff options
context:
space:
mode:
authorShenghui Wang <shhuiw@foxmail.com>2018-10-08 20:41:19 +0800
committerJens Axboe <axboe@kernel.dk>2018-10-08 08:19:56 -0600
commit8792099f9ad487cf381f4e8199ff2158ba0f6eb5 (patch)
treede54ce67b92850b3fde8e9704fedad53d5ac9c6c /drivers/md/bcache
parent149d0efada7777ad5a5242b095692af142f533d8 (diff)
downloadtalos-op-linux-8792099f9ad487cf381f4e8199ff2158ba0f6eb5.tar.gz
talos-op-linux-8792099f9ad487cf381f4e8199ff2158ba0f6eb5.zip
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 <shhuiw@foxmail.com> Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r--drivers/md/bcache/alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c
index 7a28232d868b..5002838ea476 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);
OpenPOWER on IntegriCloud