diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-09-10 17:18:59 -0700 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-10 21:56:39 -0800 |
commit | 50310164bcd789eb3690f45a9baf8a507bf93358 (patch) | |
tree | d0b3ef83632f36073f0798260e56812cb37db271 /drivers/md/bcache/btree.c | |
parent | bc9389eefe479b7b7b323c2729b61a7155d2d0ea (diff) | |
download | lwn-50310164bcd789eb3690f45a9baf8a507bf93358.tar.gz lwn-50310164bcd789eb3690f45a9baf8a507bf93358.zip |
bcache: Kill bch_next_recurse_key()
This dates from before the btree iterator, and now it's finally gone
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r-- | drivers/md/bcache/btree.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index bf8f5174b253..adc5bb0d8e92 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -1680,9 +1680,9 @@ int bch_gc_thread_start(struct cache_set *c) static int bch_btree_check_recurse(struct btree *b, struct btree_op *op, unsigned long **seen) { - int ret; + int ret = 0; unsigned i; - struct bkey *k; + struct bkey *k, *p = NULL; struct bucket *g; struct btree_iter iter; @@ -1709,19 +1709,18 @@ static int bch_btree_check_recurse(struct btree *b, struct btree_op *op, } if (b->level) { - k = bch_next_recurse_key(b, &ZERO_KEY); + bch_btree_iter_init(b, &iter, NULL); - while (k) { - struct bkey *p = bch_next_recurse_key(b, k); - if (p) - btree_node_prefetch(b->c, p, b->level - 1); + do { + k = bch_btree_iter_next_filter(&iter, b, bch_ptr_bad); + if (k) + btree_node_prefetch(b->c, k, b->level - 1); - ret = btree(check_recurse, k, b, op, seen); - if (ret) - return ret; + if (p) + ret = btree(check_recurse, p, b, op, seen); - k = p; - } + p = k; + } while (p && !ret); } return 0; |