On Tue, Aug 01, 2023 at 04:49:19 PM -0700, Darrick J. Wong wrote: > On Mon, Jul 24, 2023 at 10:05:15AM +0530, Chandan Babu R wrote: >> This commit adds functionality to dump metadata from an XFS filesystem in >> newly introduced v2 format. >> >> Signed-off-by: Chandan Babu R <chandan.babu@xxxxxxxxxx> >> --- >> db/metadump.c | 74 ++++++++++++++++++++++++++++++++++++++++++++++++--- >> 1 file changed, 71 insertions(+), 3 deletions(-) >> >> diff --git a/db/metadump.c b/db/metadump.c >> index 7f4f0f07..9b4ed70d 100644 >> --- a/db/metadump.c >> +++ b/db/metadump.c >> @@ -3056,6 +3056,70 @@ static struct metadump_ops metadump1_ops = { >> .release = release_metadump_v1, >> }; >> >> +static int >> +init_metadump_v2(void) >> +{ >> + struct xfs_metadump_header xmh = {0}; >> + uint32_t compat_flags = 0; > > Indentation ^ of the local variables should be tabs, not a space. > >> + >> + xmh.xmh_magic = cpu_to_be32(XFS_MD_MAGIC_V2); >> + xmh.xmh_version = cpu_to_be32(2); >> + >> + if (metadump.obfuscate) >> + compat_flags |= XFS_MD2_INCOMPAT_OBFUSCATED; >> + if (!metadump.zero_stale_data) >> + compat_flags |= XFS_MD2_INCOMPAT_FULLBLOCKS; >> + if (metadump.dirty_log) >> + compat_flags |= XFS_MD2_INCOMPAT_DIRTYLOG; >> + >> + xmh.xmh_compat_flags = cpu_to_be32(compat_flags); >> + >> + if (fwrite(&xmh, sizeof(xmh), 1, metadump.outf) != 1) { >> + print_warning("error writing to target file"); >> + return -1; >> + } >> + >> + return 0; >> +} >> + >> +static int >> +write_metadump_v2( >> + enum typnm type, >> + const char *data, >> + xfs_daddr_t off, >> + int len) >> +{ >> + struct xfs_meta_extent xme; >> + uint64_t addr; > > Please line up the ^ ^ columns. > Sorry, I missed those. I will fix them. > With that fixed, > Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx> > -- chandan