Btrfs-progs: check, ability to detect and fix outdated snapshot root items
[platform/upstream/btrfs-progs.git] / extent-tree.c
index 5443ec8..080f30d 100644 (file)
@@ -29,6 +29,7 @@
 #include "volumes.h"
 #include "free-space-cache.h"
 #include "math.h"
+#include "utils.h"
 
 #define PENDING_EXTENT_INSERT 0
 #define PENDING_EXTENT_DELETE 1
@@ -972,27 +973,6 @@ static inline int extent_ref_type(u64 parent, u64 owner)
        return type;
 }
 
-static int find_next_key(struct btrfs_path *path, struct btrfs_key *key)
-
-{
-       int level;
-       for (level = 0; level < BTRFS_MAX_LEVEL; level++) {
-               if (!path->nodes[level])
-                       break;
-               if (path->slots[level] + 1 >=
-                   btrfs_header_nritems(path->nodes[level]))
-                       continue;
-               if (level == 0)
-                       btrfs_item_key_to_cpu(path->nodes[level], key,
-                                             path->slots[level] + 1);
-               else
-                       btrfs_node_key_to_cpu(path->nodes[level], key,
-                                             path->slots[level] + 1);
-               return 0;
-       }
-       return 1;
-}
-
 static int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
                                 struct btrfs_root *root,
                                 struct btrfs_path *path,