summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/alloc.c
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2020-10-01 14:50:46 +0800
committerJens Axboe <axboe@kernel.dk>2020-10-02 14:25:29 -0600
commit697e23495c94f0380c1ed8b11f830b92b64c99ea (patch)
treec422d72b305cd9302bc631db4b3bb2bc6cbf7e9c /drivers/md/bcache/alloc.c
parent17e4aed8309ff28670271546c2c3263eb12f5eb6 (diff)
bcache: explicitly make cache_set only have single cache
Currently although the bcache code has a framework for multiple caches in a cache set, but indeed the multiple caches never completed and users use md raid1 for multiple copies of the cached data. This patch does the following change in struct cache_set, to explicitly make a cache_set only have single cache, - Change pointer array "*cache[MAX_CACHES_PER_SET]" to a single pointer "*cache". - Remove pointer array "*cache_by_alloc[MAX_CACHES_PER_SET]". - Remove "caches_loaded". Now the code looks as exactly what it does in practic: only one cache is used in the cache set. Signed-off-by: Coly Li <colyli@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/alloc.c')
-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 4493ff57476d..3385f6add6df 100644
--- a/drivers/md/bcache/alloc.c
+++ b/drivers/md/bcache/alloc.c
@@ -501,7 +501,7 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,
bkey_init(k);
- ca = c->cache_by_alloc[0];
+ ca = c->cache;
b = bch_bucket_alloc(ca, reserve, wait);
if (b == -1)
goto err;