summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-01-03 13:23:19 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commitbd09835d9aad9c7b664cddc8435cc37b86077971 (patch)
tree3c73acd10104242fff27916b88fb7a68dbe652c5 /fs/btrfs/extent-tree.c
parent98ed51747b63435b9987ef12692a75c223818bbe (diff)
downloadlwn-bd09835d9aad9c7b664cddc8435cc37b86077971.tar.gz
lwn-bd09835d9aad9c7b664cddc8435cc37b86077971.zip
count_snapshots: Properly update the leaf pointer after btrfs_next_leaf
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 4957cface9ab..b801eb4b3eef 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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;