summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-15 15:18:43 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-15 15:18:43 -0400
commit1d4f6404de26df49eb8452f8fdf7672b59f407fc (patch)
tree9bbc9fdd45f8e9fc5444e8c84f4777a607c13e2b /fs/btrfs/print-tree.c
parent24af03ea5e765d57860c975efcdcd41ec7f63fd9 (diff)
downloadlinux-1d4f6404de26df49eb8452f8fdf7672b59f407fc.tar.gz
linux-1d4f6404de26df49eb8452f8fdf7672b59f407fc.tar.bz2
linux-1d4f6404de26df49eb8452f8fdf7672b59f407fc.zip
Btrfs: directory testing code and dir item 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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index f2745b247473..ad244d658117 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -12,7 +12,10 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
struct btrfs_item *item;
struct btrfs_extent_item *ei;
struct btrfs_root_item *ri;
+ struct btrfs_dir_item *di;
u32 type;
+ u32 namelen;
+
printf("leaf %Lu total ptrs %d free space %d\n",
btrfs_header_blocknr(&l->header), nr,
btrfs_leaf_free_space(root, l));
@@ -31,6 +34,15 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
case BTRFS_INODE_ITEM_KEY:
break;
case BTRFS_DIR_ITEM_KEY:
+ namelen = btrfs_item_size(l->items + i) - sizeof(*di);
+ di = btrfs_item_ptr(l, i, struct btrfs_dir_item);
+ printf("\t\tdir oid %Lu flags %u type %u\n",
+ btrfs_dir_objectid(di),
+ btrfs_dir_flags(di),
+ btrfs_dir_type(di));
+ printf("\t\tname %.*s\n",
+ namelen, (char *)(di + 1));
+
break;
case BTRFS_ROOT_ITEM_KEY:
ri = btrfs_item_ptr(l, i, struct btrfs_root_item);