aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-14 10:31:29 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-14 10:31:29 -0400
commit4beb1b8b75a86373f6020103ab840448d14c8880 (patch)
tree944e80ccd6764afd16b4e31d5595d2decf36dabc /fs/btrfs/print-tree.c
parent710874947aa0f81c3b348b052e81cb9075113c49 (diff)
Btrfs: add leaf data casting helper
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r--fs/btrfs/print-tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 64829b6b90f..e769f36cf05 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -26,11 +26,10 @@ void btrfs_print_leaf(struct btrfs_leaf *l)
btrfs_item_size(item));
printf("\t\titem data %.*s\n", btrfs_item_size(item),
l->data + btrfs_item_offset(item));
- ei = (struct btrfs_extent_item *)(l->data +
- btrfs_item_offset(item));
+ ei = btrfs_item_ptr(l, i, struct btrfs_extent_item);
printf("\t\textent data refs %u owner %Lu\n",
btrfs_extent_refs(ei), btrfs_extent_owner(ei));
- ri = (struct btrfs_root_item *)ei;
+ ri = btrfs_item_ptr(l, i, struct btrfs_root_item);
printf("\t\troot data blocknr %Lu refs %u\n",
btrfs_root_blocknr(ri), btrfs_root_refs(ri));
fflush(stdout);