Commit 74d4ce92 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

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: default avatarColy Li <colyli@suse.de>
Link: https://lore.kernel.org/r/20240528120914.28705-4-colyli@suse.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 05356938
...@@ -498,8 +498,8 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve, ...@@ -498,8 +498,8 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,
ca = c->cache; ca = c->cache;
b = bch_bucket_alloc(ca, reserve, wait); b = bch_bucket_alloc(ca, reserve, wait);
if (b == -1) if (b < 0)
goto err; return -1;
k->ptr[0] = MAKE_PTR(ca->buckets[b].gen, k->ptr[0] = MAKE_PTR(ca->buckets[b].gen,
bucket_to_sector(c, b), bucket_to_sector(c, b),
...@@ -508,10 +508,6 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve, ...@@ -508,10 +508,6 @@ int __bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,
SET_KEY_PTRS(k, 1); SET_KEY_PTRS(k, 1);
return 0; 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, int bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment