summaryrefslogtreecommitdiff
path: root/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'extent-tree.c')
-rw-r--r--extent-tree.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/extent-tree.c b/extent-tree.c
index 7f156d9b..3767744f 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -41,9 +41,7 @@ static int inc_block_ref(struct btrfs_root *root, u64 blocknr)
BUG();
BUG_ON(ret != 0);
l = &path.nodes[0]->leaf;
- item = (struct btrfs_extent_item *)(l->data +
- btrfs_item_offset(l->items +
- path.slots[0]));
+ item = btrfs_item_ptr(l, path.slots[0], struct btrfs_extent_item);
refs = btrfs_extent_refs(item);
btrfs_set_extent_refs(item, refs + 1);
@@ -69,9 +67,7 @@ static int lookup_block_ref(struct btrfs_root *root, u64 blocknr, u32 *refs)
if (ret != 0)
BUG();
l = &path.nodes[0]->leaf;
- item = (struct btrfs_extent_item *)(l->data +
- btrfs_item_offset(l->items +
- path.slots[0]));
+ item = btrfs_item_ptr(l, path.slots[0], struct btrfs_extent_item);
*refs = btrfs_extent_refs(item);
btrfs_release_path(root->extent_root, &path);
return 0;