mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-30 09:21:45 +00:00
btrfs-progs: print-tree: factor out shared_data_ref dump
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c23c1271d3
commit
b3122697f6
17
print-tree.c
17
print-tree.c
@ -983,6 +983,15 @@ static void print_extent_data_ref(struct extent_buffer *eb, int slot)
|
||||
btrfs_extent_data_ref_count(eb, dref));
|
||||
}
|
||||
|
||||
static void print_shared_data_ref(struct extent_buffer *eb, int slot)
|
||||
{
|
||||
struct btrfs_shared_data_ref *sref;
|
||||
|
||||
sref = btrfs_item_ptr(eb, slot, struct btrfs_shared_data_ref);
|
||||
printf("\t\tshared data backref count %u\n",
|
||||
btrfs_shared_data_ref_count(eb, sref));
|
||||
}
|
||||
|
||||
/* Caller must ensure sizeof(*ret) >= 14 "WRITTEN|RELOC" */
|
||||
static void header_flags_to_str(u64 flags, char *ret)
|
||||
{
|
||||
@ -1104,13 +1113,9 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *eb)
|
||||
case BTRFS_EXTENT_DATA_REF_KEY:
|
||||
print_extent_data_ref(eb, i);
|
||||
break;
|
||||
case BTRFS_SHARED_DATA_REF_KEY: {
|
||||
struct btrfs_shared_data_ref *sref;
|
||||
sref = btrfs_item_ptr(eb, i, struct btrfs_shared_data_ref);
|
||||
printf("\t\tshared data backref count %u\n",
|
||||
btrfs_shared_data_ref_count(eb, sref));
|
||||
case BTRFS_SHARED_DATA_REF_KEY:
|
||||
print_shared_data_ref(eb, i);
|
||||
break;
|
||||
}
|
||||
case BTRFS_EXTENT_REF_V0_KEY:
|
||||
#ifdef BTRFS_COMPAT_EXTENT_TREE_V0
|
||||
print_extent_ref_v0(eb, i);
|
||||
|
Loading…
Reference in New Issue
Block a user