From: Darrick J. Wong Date: Tue, 12 Jul 2022 18:24:33 +0000 (-0500) Subject: xfs_db: identify the minlogsize transaction reservation X-Git-Tag: v5.19.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=766bfbd71f5cf596b5aec66772eb8326fdb3dd63;p=thirdparty%2Fxfsprogs-dev.git xfs_db: identify the minlogsize transaction reservation Right now, we don't make it easy to spot the transaction reservation used to compute the minimum log size in userspace: # xfs_db -c logres /dev/sda type 0 logres 168184 logcount 5 flags 0x4 ... type 25 logres 760 logcount 0 flags 0x0 type -1 logres 547200 logcount 8 flags 0x4 Type "-1" doesn't communicate the purpose at all, it just looks like a math error. Help out the user a bit by printing more information: minlogsize logres 547200 logcount 8 Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Eric Sandeen --- diff --git a/db/logformat.c b/db/logformat.c index 38b0af112..5edaa5494 100644 --- a/db/logformat.c +++ b/db/logformat.c @@ -160,8 +160,10 @@ logres_f( end_res = (struct xfs_trans_res *)(M_RES(mp) + 1); for (i = 0; res < end_res; i++, res++) print_logres(i, res); + libxfs_log_get_max_trans_res(mp, &resv); - print_logres(-1, &resv); + dbprintf(_("minlogsize logres %u logcount %d\n"), + resv.tr_logres, resv.tr_logcount); return 0; }