From: Christoph Hellwig Date: Fri, 20 Dec 2024 03:55:59 +0000 (-0800) Subject: xfs_growfs: support internal RT devices X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Fxfs-zoned;p=users%2Fhch%2Fxfsprogs.git xfs_growfs: support internal RT devices Allow RT growfs when rtstart is set in the geomety, and adjust the queried size for it. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" --- diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index 4b941403e..0d0b2ae3e 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -202,7 +202,7 @@ main(int argc, char **argv) progname, fname); exit(1); } - if (rflag && !xi.rt.dev) { + if (rflag && (!xi.rt.dev && !geo.rtstart)) { fprintf(stderr, _("%s: failed to access realtime device for %s\n"), progname, fname); @@ -211,6 +211,13 @@ main(int argc, char **argv) xfs_report_geom(&geo, datadev, logdev, rtdev); + if (geo.rtstart) { + xfs_daddr_t rtstart = geo.rtstart * (geo.blocksize / BBSIZE); + + xi.rt.size = xi.data.size - rtstart; + xi.data.size = rtstart; + } + ddsize = xi.data.size; dlsize = (xi.log.size ? xi.log.size : geo.logblocks * (geo.blocksize / BBSIZE) );