aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-12 20:12:07 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-12 20:12:07 -0400
commit0783fcfc4dc19b8bb99bd51b7afa669ba4cbd377 (patch)
tree0d7d68c33e8ff954e7614395f05d01d47d107f05 /fs/btrfs/print-tree.c
parente2fa7227cdf132d72e7410dd0679dc573a1c2618 (diff)
Btrfs: struct item endian fixes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/print-tree.c')
-rw-r--r--fs/btrfs/print-tree.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 7df16b1e4733..33f5ee4052c1 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -9,7 +9,7 @@ void print_leaf(struct leaf *l)
9{ 9{
10 int i; 10 int i;
11 u32 nr = btrfs_header_nritems(&l->header); 11 u32 nr = btrfs_header_nritems(&l->header);
12 struct item *item; 12 struct btrfs_item *item;
13 struct extent_item *ei; 13 struct extent_item *ei;
14 printf("leaf %Lu total ptrs %d free space %d\n", 14 printf("leaf %Lu total ptrs %d free space %d\n",
15 btrfs_header_blocknr(&l->header), nr, leaf_free_space(l)); 15 btrfs_header_blocknr(&l->header), nr, leaf_free_space(l));
@@ -18,12 +18,15 @@ void print_leaf(struct leaf *l)
18 item = l->items + i; 18 item = l->items + i;
19 printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n", 19 printf("\titem %d key (%Lu %u %Lu) itemoff %d itemsize %d\n",
20 i, 20 i,
21 item->key.objectid, item->key.flags, item->key.offset, 21 btrfs_key_objectid(&item->key),
22 item->offset, item->size); 22 btrfs_key_flags(&item->key),
23 btrfs_key_offset(&item->key),
24 btrfs_item_offset(item),
25 btrfs_item_size(item));
23 fflush(stdout); 26 fflush(stdout);
24 printf("\t\titem data %.*s\n", item->size, 27 printf("\t\titem data %.*s\n", btrfs_item_size(item),
25 l->data+item->offset); 28 l->data + btrfs_item_offset(item));
26 ei = (struct extent_item *)(l->data + item->offset); 29 ei = (struct extent_item *)(l->data + btrfs_item_offset(item));
27 printf("\t\textent data refs %u owner %Lu\n", ei->refs, 30 printf("\t\textent data refs %u owner %Lu\n", ei->refs,
28 ei->owner); 31 ei->owner);
29 fflush(stdout); 32 fflush(stdout);