summaryrefslogtreecommitdiff
path: root/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
commit942050de0e7cd8ba5fbe312659a8824e0b8ee9ba (patch)
tree798044542e3c5defee8169905f90f99d6f1f0df9 /print-tree.c
parent0975c87bcefbc7e3a6c52af13c604ea3b3f3bb10 (diff)
add leaf data casting helper
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/print-tree.c b/print-tree.c
index 64829b6b..e769f36c 100644
--- a/print-tree.c
+++ b/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);