* [PATCH] btrfs: add remap tree definitions for print-tree
@ 2026-02-09 18:10 Mark Harmstone
2026-02-10 8:19 ` Johannes Thumshirn
2026-02-10 8:27 ` Qu Wenruo
0 siblings, 2 replies; 3+ messages in thread
From: Mark Harmstone @ 2026-02-09 18:10 UTC (permalink / raw)
To: linux-btrfs; +Cc: Mark Harmstone
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.
Signed-off-by: Mark Harmstone <mark@harmstone.com>
---
fs/btrfs/print-tree.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index f189bf09ce6a..b7dfe877cf8d 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -38,6 +38,7 @@ static const struct root_name_map root_map[] = {
{ BTRFS_BLOCK_GROUP_TREE_OBJECTID, "BLOCK_GROUP_TREE" },
{ BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" },
{ BTRFS_RAID_STRIPE_TREE_OBJECTID, "RAID_STRIPE_TREE" },
+ { BTRFS_REMAP_TREE_OBJECTID, "REMAP_TREE" },
};
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
[BTRFS_UUID_KEY_SUBVOL] = "UUID_KEY_SUBVOL",
[BTRFS_UUID_KEY_RECEIVED_SUBVOL] = "UUID_KEY_RECEIVED_SUBVOL",
[BTRFS_RAID_STRIPE_KEY] = "RAID_STRIPE",
+ [BTRFS_IDENTITY_REMAP_KEY] = "IDENTITY_REMAP",
+ [BTRFS_REMAP_KEY] = "REMAP",
+ [BTRFS_REMAP_BACKREF_KEY] = "REMAP_BACKREF",
};
if (key->type == 0 && key->objectid == BTRFS_FREE_SPACE_OBJECTID)
@@ -435,6 +439,7 @@ void btrfs_print_leaf(const struct extent_buffer *l)
struct btrfs_extent_data_ref *dref;
struct btrfs_shared_data_ref *sref;
struct btrfs_dev_extent *dev_extent;
+ struct btrfs_remap_item *remap;
struct btrfs_key key;
if (!l)
@@ -569,6 +574,11 @@ void btrfs_print_leaf(const struct extent_buffer *l)
print_raid_stripe_key(l, btrfs_item_size(l, i),
btrfs_item_ptr(l, i, struct btrfs_stripe_extent));
break;
+ case BTRFS_REMAP_KEY:
+ case BTRFS_REMAP_BACKREF_KEY:
+ remap = btrfs_item_ptr(l, i, struct btrfs_remap_item);
+ pr_info("\t\taddress %llu\n", btrfs_remap_address(l, remap));
+ break;
}
}
}
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] btrfs: add remap tree definitions for print-tree
2026-02-09 18:10 [PATCH] btrfs: add remap tree definitions for print-tree Mark Harmstone
@ 2026-02-10 8:19 ` Johannes Thumshirn
2026-02-10 8:27 ` Qu Wenruo
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2026-02-10 8:19 UTC (permalink / raw)
To: Mark Harmstone, linux-btrfs@vger.kernel.org
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: add remap tree definitions for print-tree
2026-02-09 18:10 [PATCH] btrfs: add remap tree definitions for print-tree Mark Harmstone
2026-02-10 8:19 ` Johannes Thumshirn
@ 2026-02-10 8:27 ` Qu Wenruo
1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-02-10 8:27 UTC (permalink / raw)
To: Mark Harmstone, linux-btrfs
在 2026/2/10 04:40, Mark Harmstone 写道:
> 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.
>
> Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> fs/btrfs/print-tree.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
> index f189bf09ce6a..b7dfe877cf8d 100644
> --- a/fs/btrfs/print-tree.c
> +++ b/fs/btrfs/print-tree.c
> @@ -38,6 +38,7 @@ static const struct root_name_map root_map[] = {
> { BTRFS_BLOCK_GROUP_TREE_OBJECTID, "BLOCK_GROUP_TREE" },
> { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" },
> { BTRFS_RAID_STRIPE_TREE_OBJECTID, "RAID_STRIPE_TREE" },
> + { BTRFS_REMAP_TREE_OBJECTID, "REMAP_TREE" },
> };
>
> 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
> [BTRFS_UUID_KEY_SUBVOL] = "UUID_KEY_SUBVOL",
> [BTRFS_UUID_KEY_RECEIVED_SUBVOL] = "UUID_KEY_RECEIVED_SUBVOL",
> [BTRFS_RAID_STRIPE_KEY] = "RAID_STRIPE",
> + [BTRFS_IDENTITY_REMAP_KEY] = "IDENTITY_REMAP",
> + [BTRFS_REMAP_KEY] = "REMAP",
> + [BTRFS_REMAP_BACKREF_KEY] = "REMAP_BACKREF",
> };
>
> if (key->type == 0 && key->objectid == BTRFS_FREE_SPACE_OBJECTID)
> @@ -435,6 +439,7 @@ void btrfs_print_leaf(const struct extent_buffer *l)
> struct btrfs_extent_data_ref *dref;
> struct btrfs_shared_data_ref *sref;
> struct btrfs_dev_extent *dev_extent;
> + struct btrfs_remap_item *remap;
> struct btrfs_key key;
>
> if (!l)
> @@ -569,6 +574,11 @@ void btrfs_print_leaf(const struct extent_buffer *l)
> print_raid_stripe_key(l, btrfs_item_size(l, i),
> btrfs_item_ptr(l, i, struct btrfs_stripe_extent));
> break;
> + case BTRFS_REMAP_KEY:
> + case BTRFS_REMAP_BACKREF_KEY:
> + remap = btrfs_item_ptr(l, i, struct btrfs_remap_item);
> + pr_info("\t\taddress %llu\n", btrfs_remap_address(l, remap));
> + break;
> }
> }
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-10 8:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 18:10 [PATCH] btrfs: add remap tree definitions for print-tree Mark Harmstone
2026-02-10 8:19 ` Johannes Thumshirn
2026-02-10 8:27 ` Qu Wenruo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox