aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r--fs/btrfs/backref.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 2d3e32ebfd15..8729cf68d2fe 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -1552,7 +1552,6 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb,
1552{ 1552{
1553 int ret; 1553 int ret;
1554 int type; 1554 int type;
1555 struct btrfs_tree_block_info *info;
1556 struct btrfs_extent_inline_ref *eiref; 1555 struct btrfs_extent_inline_ref *eiref;
1557 1556
1558 if (*ptr == (unsigned long)-1) 1557 if (*ptr == (unsigned long)-1)
@@ -1573,9 +1572,17 @@ int tree_backref_for_extent(unsigned long *ptr, struct extent_buffer *eb,
1573 } 1572 }
1574 1573
1575 /* we can treat both ref types equally here */ 1574 /* we can treat both ref types equally here */
1576 info = (struct btrfs_tree_block_info *)(ei + 1);
1577 *out_root = btrfs_extent_inline_ref_offset(eb, eiref); 1575 *out_root = btrfs_extent_inline_ref_offset(eb, eiref);
1578 *out_level = btrfs_tree_block_level(eb, info); 1576
1577 if (key->type == BTRFS_EXTENT_ITEM_KEY) {
1578 struct btrfs_tree_block_info *info;
1579
1580 info = (struct btrfs_tree_block_info *)(ei + 1);
1581 *out_level = btrfs_tree_block_level(eb, info);
1582 } else {
1583 ASSERT(key->type == BTRFS_METADATA_ITEM_KEY);
1584 *out_level = (u8)key->offset;
1585 }
1579 1586
1580 if (ret == 1) 1587 if (ret == 1)
1581 *ptr = (unsigned long)-1; 1588 *ptr = (unsigned long)-1;