]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bcache: Kill bch_next_recurse_key()
authorKent Overstreet <kmo@daterainc.com>
Wed, 11 Sep 2013 00:18:59 +0000 (17:18 -0700)
committerKent Overstreet <kmo@daterainc.com>
Wed, 11 Sep 2013 02:07:41 +0000 (19:07 -0700)
This dates from before the btree iterator, and now it's finally gone

Signed-off-by: Kent Overstreet <kmo@daterainc.com>
drivers/md/bcache/bset.c
drivers/md/bcache/bset.h
drivers/md/bcache/btree.c

index 84839666e1bed2465d40824d8790f4fbdd266553..4b53b5ad12a6a172421b8d70822d64cb0f68c901 100644 (file)
@@ -952,14 +952,6 @@ struct bkey *bch_btree_iter_next_filter(struct btree_iter *iter,
        return ret;
 }
 
-struct bkey *bch_next_recurse_key(struct btree *b, struct bkey *search)
-{
-       struct btree_iter iter;
-
-       bch_btree_iter_init(b, &iter, search);
-       return bch_btree_iter_next_filter(&iter, b, bch_ptr_bad);
-}
-
 /* Mergesort */
 
 static void sort_key_next(struct btree_iter *iter,
index 73684fdcd4c47e6a99708e4284146416ba75baf5..d82c128d5b43a1d40d20ad0388896b9065a0c5a3 100644 (file)
@@ -303,7 +303,6 @@ static inline bool ptr_available(struct cache_set *c, const struct bkey *k,
 
 typedef bool (*ptr_filter_fn)(struct btree *, const struct bkey *);
 
-struct bkey *bch_next_recurse_key(struct btree *, struct bkey *);
 struct bkey *bch_btree_iter_next(struct btree_iter *);
 struct bkey *bch_btree_iter_next_filter(struct btree_iter *,
                                        struct btree *, ptr_filter_fn);
index 37e653e4510373e8e3cc6e5b1f97bf8ac9a6e712..99d87ffa991dde21b86130520a59b3ec2f61f47a 100644 (file)
@@ -1671,9 +1671,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;
 
@@ -1700,19 +1700,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;