count_snapshots: Properly update the leaf pointer after btrfs_next_leaf
authorChris Mason <chris.mason@oracle.com>
Thu, 3 Jan 2008 18:23:19 +0000 (13:23 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:58 +0000 (11:03 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c
fs/btrfs/inode.c

index 4957cface9abf39e42ba25146d12643c0adba594..b801eb4b3eefb90904707904f6027c8232b0bc5e 100644 (file)
@@ -693,7 +693,6 @@ u32 btrfs_count_snapshots_in_path(struct btrfs_root *root,
        u64 root_objectid = root->root_key.objectid;
        u32 total_count = 0;
        u32 cur_count;
-       u32 refs;
        u32 nritems;
        int ret;
        struct btrfs_key key;
@@ -729,8 +728,8 @@ again:
        }
 
        item = btrfs_item_ptr(l, path->slots[0], struct btrfs_extent_item);
-       refs = btrfs_extent_refs(l, item);
        while (1) {
+               l = path->nodes[0];
                nritems = btrfs_header_nritems(l);
                if (path->slots[0] >= nritems) {
                        ret = btrfs_next_leaf(extent_root, path);
@@ -741,6 +740,7 @@ again:
                btrfs_item_key_to_cpu(l, &found_key, path->slots[0]);
                if (found_key.objectid != bytenr)
                        break;
+
                if (found_key.type != BTRFS_EXTENT_REF_KEY) {
                        path->slots[0]++;
                        continue;
index 8a2001bbf1048b4af8064ff67ad963415ae85ebf..6e2d03626fb9e15c8f1c81d49e9893f8c8a52ee6 100644 (file)
@@ -208,7 +208,7 @@ again:
                }
 
                start = extent_end;
-       } else if (found_type == BTRFS_FILE_EXTENT_INLINE) {
+       } else {
                goto not_found;
        }
 loop: