Commit ef4eeb85 authored by Xu Wang's avatar Xu Wang Committed by Jens Axboe

bcache: journel: use for_each_clear_bit() to simplify the code

Using for_each_clear_bit() to simplify the code.
Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5fe48867
...@@ -217,10 +217,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list) ...@@ -217,10 +217,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
*/ */
pr_debug("falling back to linear search\n"); pr_debug("falling back to linear search\n");
for (l = find_first_zero_bit(bitmap, ca->sb.njournal_buckets); for_each_clear_bit(l, bitmap, ca->sb.njournal_buckets)
l < ca->sb.njournal_buckets;
l = find_next_zero_bit(bitmap, ca->sb.njournal_buckets,
l + 1))
if (read_bucket(l)) if (read_bucket(l))
goto bsearch; goto bsearch;
......
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