From: Darrick J. Wong Date: Thu, 21 Nov 2024 00:24:16 +0000 (-0800) Subject: xfs_db: show the metadata root directory when dumping superblocks X-Git-Tag: v6.13.0~164 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720eb8752fdd7b282bd180d46b31f2408efe6888;p=thirdparty%2Fxfsprogs-dev.git xfs_db: show the metadata root directory when dumping superblocks Show the metadirino field when appropriate. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/db/sb.c b/db/sb.c index 4f115650..fa15b429 100644 --- a/db/sb.c +++ b/db/sb.c @@ -50,6 +50,18 @@ sb_init(void) add_command(&version_cmd); } +/* + * Counts superblock fields that only exist when the metadata directory feature + * is enabled. + */ +static int +metadirfld_count( + void *obj, + int startoff) +{ + return xfs_has_metadir(mp) ? 1 : 0; +} + #define OFF(f) bitize(offsetof(struct xfs_dsb, sb_ ## f)) #define SZC(f) szcount(struct xfs_dsb, sb_ ## f) const field_t sb_flds[] = { @@ -113,6 +125,8 @@ const field_t sb_flds[] = { { "pquotino", FLDT_INO, OI(OFF(pquotino)), C1, 0, TYP_INODE }, { "lsn", FLDT_UINT64X, OI(OFF(lsn)), C1, 0, TYP_NONE }, { "meta_uuid", FLDT_UUID, OI(OFF(meta_uuid)), C1, 0, TYP_NONE }, + { "metadirino", FLDT_INO, OI(OFF(metadirino)), metadirfld_count, + FLD_COUNT, TYP_INODE }, { NULL } };