diff options
author | Coly Li <colyli@suse.de> | 2024-05-28 20:09:14 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-05-28 06:55:59 -0600 |
commit | 74d4ce92e08d5669d66fd890403724faa4286c21 (patch) | |
tree | 925167fa3a00b12512e4fec28a4df2f9e0d4ce4c /drivers/md/bcache | |
parent | 05356938a4be356adde4eab4425c6822f3c7d706 (diff) | |
download | linux-stable-74d4ce92e08d5669d66fd890403724faa4286c21.tar.gz linux-stable-74d4ce92e08d5669d66fd890403724faa4286c21.tar.bz2 linux-stable-74d4ce92e08d5669d66fd890403724faa4286c21.zip |
bcache: code cleanup in __bch_bucket_alloc_set()
In __bch_bucket_alloc_set() the lines after lable 'err:' indeed do
nothing useful after multiple cache devices are removed from bcache
code. This cleanup patch drops the useless code to save a bit CPU
cycles.
Signed-off-by: Coly Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20240528120914.28705-4-colyli@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache')
-rw-r--r-- | drivers/md/bcache/alloc.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 32a46343097d..48ce750bf70a 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -498,8 +498,8 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve, ca = c->cache; b = bch_bucket_alloc(ca, reserve, wait); - if (b == -1) - goto err; + if (b < 0) + return -1; k->ptr[0] = MAKE_PTR(ca->buckets[b].gen, bucket_to_sector(c, b), @@ -508,10 +508,6 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve, SET_KEY_PTRS(k, 1); return 0; -err: - bch_bucket_free(c, k); - bkey_put(c, k); - return -1; } int bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve, |