summaryrefslogtreecommitdiff
path: root/print-tree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-11-18 10:34:08 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-18 10:34:08 -0500
commit2d9bc57b9ae79ad3648a57b431b9d82e88114132 (patch)
tree18c1d81bb7ab25f20df6b5b062827d5e5a8842a4 /print-tree.c
parent6c771595afad6e04c25b5adaea8ffbbbfe9c728c (diff)
Add disk format requirements for subvol backward and forward refs
Diffstat (limited to 'print-tree.c')
-rw-r--r--print-tree.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/print-tree.c b/print-tree.c
index 96e1b341..eac4d52a 100644
--- a/print-tree.c
+++ b/print-tree.c
@@ -159,6 +159,21 @@ static void print_file_extent_item(struct extent_buffer *eb,
}
+static void print_root_ref(struct extent_buffer *leaf, int slot, char *tag)
+{
+ struct btrfs_root_ref *ref;
+ char namebuf[BTRFS_NAME_LEN];
+ int namelen;
+
+ ref = btrfs_item_ptr(leaf, slot, struct btrfs_root_ref);
+ namelen = btrfs_root_ref_name_len(leaf, ref);
+ read_extent_buffer(leaf, namebuf, (unsigned long)(ref + 1), namelen);
+ printf("\t\troot %s key dirid %llu sequence %llu name %.*s\n", tag,
+ (unsigned long long)btrfs_root_ref_dirid(leaf, ref),
+ (unsigned long long)btrfs_root_ref_sequence(leaf, ref),
+ namelen, namebuf);
+}
+
void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
{
int i;
@@ -240,6 +255,12 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
root_item.drop_level);
}
break;
+ case BTRFS_ROOT_REF_KEY:
+ print_root_ref(l, i, "ref");
+ break;
+ case BTRFS_ROOT_BACKREF_KEY:
+ print_root_ref(l, i, "backref");
+ break;
case BTRFS_EXTENT_ITEM_KEY:
ei = btrfs_item_ptr(l, i, struct btrfs_extent_item);
printf("\t\textent data refs %u\n",