Btrfs: variable block size support
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 3767744..d4f1ec3 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -143,7 +143,6 @@
struct btrfs_key key;
struct btrfs_root *extent_root = root->extent_root;
int ret;
- struct btrfs_item *item;
struct btrfs_extent_item *ei;
struct btrfs_key ins;
u32 refs;
@@ -161,9 +160,8 @@
printf("failed to find %Lu\n", key.objectid);
BUG();
}
- item = path.nodes[0]->leaf.items + path.slots[0];
- ei = (struct btrfs_extent_item *)(path.nodes[0]->leaf.data +
- btrfs_item_offset(item));
+ ei = btrfs_item_ptr(&path.nodes[0]->leaf, path.slots[0],
+ struct btrfs_extent_item);
BUG_ON(ei->refs == 0);
refs = btrfs_extent_refs(ei) - 1;
btrfs_set_extent_refs(ei, refs);