Skip to content

Commit b85cfdf

Browse files
maharmstonekdave
authored andcommitted
btrfs: print-tree: add remap tree definitions
Add the definitions for the remap tree to print-tree.c, so that we get more useful information if a tree is dumped to dmesg. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Mark Harmstone <mark@harmstone.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent f8db800 commit b85cfdf

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

fs/btrfs/print-tree.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static const struct root_name_map root_map[] = {
3838
{ BTRFS_BLOCK_GROUP_TREE_OBJECTID, "BLOCK_GROUP_TREE" },
3939
{ BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" },
4040
{ BTRFS_RAID_STRIPE_TREE_OBJECTID, "RAID_STRIPE_TREE" },
41+
{ BTRFS_REMAP_TREE_OBJECTID, "REMAP_TREE" },
4142
};
4243

4344
const char *btrfs_root_name(const struct btrfs_key *key, char *buf)
@@ -415,6 +416,9 @@ static void key_type_string(const struct btrfs_key *key, char *buf, int buf_size
415416
[BTRFS_UUID_KEY_SUBVOL] = "UUID_KEY_SUBVOL",
416417
[BTRFS_UUID_KEY_RECEIVED_SUBVOL] = "UUID_KEY_RECEIVED_SUBVOL",
417418
[BTRFS_RAID_STRIPE_KEY] = "RAID_STRIPE",
419+
[BTRFS_IDENTITY_REMAP_KEY] = "IDENTITY_REMAP",
420+
[BTRFS_REMAP_KEY] = "REMAP",
421+
[BTRFS_REMAP_BACKREF_KEY] = "REMAP_BACKREF",
418422
};
419423

420424
if (key->type == 0 && key->objectid == BTRFS_FREE_SPACE_OBJECTID)
@@ -435,6 +439,7 @@ void btrfs_print_leaf(const struct extent_buffer *l)
435439
struct btrfs_extent_data_ref *dref;
436440
struct btrfs_shared_data_ref *sref;
437441
struct btrfs_dev_extent *dev_extent;
442+
struct btrfs_remap_item *remap;
438443
struct btrfs_key key;
439444

440445
if (!l)
@@ -569,6 +574,11 @@ void btrfs_print_leaf(const struct extent_buffer *l)
569574
print_raid_stripe_key(l, btrfs_item_size(l, i),
570575
btrfs_item_ptr(l, i, struct btrfs_stripe_extent));
571576
break;
577+
case BTRFS_REMAP_KEY:
578+
case BTRFS_REMAP_BACKREF_KEY:
579+
remap = btrfs_item_ptr(l, i, struct btrfs_remap_item);
580+
pr_info("\t\taddress %llu\n", btrfs_remap_address(l, remap));
581+
break;
572582
}
573583
}
574584
}

0 commit comments

Comments
 (0)