Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
To: boris@bur.io, linux-btrfs@vger.kernel.org, kernel-team@fb.com
Cc: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Subject: [PATCH] btrfs-progs: add print support for verity items.
Date: Wed, 23 Mar 2022 15:45:05 -0400	[thread overview]
Message-ID: <20220323194504.1777182-1-sweettea-kernel@dorminy.me> (raw)

'btrfs inspect-internals dump-tree' doesn't currently know about the two
types of verity items and prints them as 'UNKNOWN.36' or 'UNKNOWN.37'.
So add them to the known item types.

Suggested-by: Boris Burkov <boris@bur.io>
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>

---

Inspired by Boris' recent patchset noting that these items were not yet
properly printed:
https://lore.kernel.org/linux-btrfs/5579a70597cd660ffb265db9e97840a1faca8812.1647382272.git.boris@bur.io/T/#u

---

 kernel-shared/ctree.h      | 4 ++++
 kernel-shared/print-tree.c | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index bf71fc85..b8d7e5a8 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -1350,6 +1350,10 @@ static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info)
 #define BTRFS_INODE_REF_KEY		12
 #define BTRFS_INODE_EXTREF_KEY		13
 #define BTRFS_XATTR_ITEM_KEY		24
+
+#define BTRFS_VERITY_DESC_ITEM_KEY	36
+#define BTRFS_VERITY_MERKLE_ITEM_KEY	37
+
 #define BTRFS_ORPHAN_ITEM_KEY		48
 
 #define BTRFS_DIR_LOG_ITEM_KEY  60
diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c
index 73f969c3..ee7f679c 100644
--- a/kernel-shared/print-tree.c
+++ b/kernel-shared/print-tree.c
@@ -647,6 +647,8 @@ void print_key_type(FILE *stream, u64 objectid, u8 type)
 		[BTRFS_DIR_LOG_ITEM_KEY]	= "DIR_LOG_ITEM",
 		[BTRFS_DIR_LOG_INDEX_KEY]	= "DIR_LOG_INDEX",
 		[BTRFS_XATTR_ITEM_KEY]		= "XATTR_ITEM",
+		[BTRFS_VERITY_DESC_ITEM_KEY]	= "VERITY_DESC_ITEM",
+		[BTRFS_VERITY_MERKLE_ITEM_KEY	= "VERITY_MERKLE_ITEM",
 		[BTRFS_ORPHAN_ITEM_KEY]		= "ORPHAN_ITEM",
 		[BTRFS_ROOT_ITEM_KEY]		= "ROOT_ITEM",
 		[BTRFS_ROOT_REF_KEY]		= "ROOT_REF",
-- 
2.35.1


             reply	other threads:[~2022-03-23 19:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-23 19:45 Sweet Tea Dorminy [this message]
2022-03-23 20:11 ` [PATCH] btrfs-progs: add print support for verity items Josef Bacik
2022-03-23 21:14 ` David Sterba
2022-03-23 23:38 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220323194504.1777182-1-sweettea-kernel@dorminy.me \
    --to=sweettea-kernel@dorminy.me \
    --cc=boris@bur.io \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox