Commit 14215ee0 authored by Coly Li's avatar Coly Li Committed by Jens Axboe

bcache: move definition of 'int ret' out of macro read_bucket()

'int ret' is defined as a local variable inside macro read_bucket().
Since this macro is called multiple times, and following patches will
use a 'int ret' variable in bch_journal_read(), this patch moves
definition of 'int ret' from macro read_bucket() to range of function
bch_journal_read().
Signed-off-by: default avatarColy Li <colyli@suse.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a4b732a2
...@@ -147,7 +147,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list) ...@@ -147,7 +147,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
{ {
#define read_bucket(b) \ #define read_bucket(b) \
({ \ ({ \
int ret = journal_read_bucket(ca, list, b); \ ret = journal_read_bucket(ca, list, b); \
__set_bit(b, bitmap); \ __set_bit(b, bitmap); \
if (ret < 0) \ if (ret < 0) \
return ret; \ return ret; \
...@@ -156,6 +156,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list) ...@@ -156,6 +156,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
struct cache *ca; struct cache *ca;
unsigned int iter; unsigned int iter;
int ret = 0;
for_each_cache(ca, c, iter) { for_each_cache(ca, c, iter) {
struct journal_device *ja = &ca->journal; struct journal_device *ja = &ca->journal;
...@@ -267,7 +268,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list) ...@@ -267,7 +268,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
struct journal_replay, struct journal_replay,
list)->j.seq; list)->j.seq;
return 0; return ret;
#undef read_bucket #undef read_bucket
} }
......
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