]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_growfs: support internal RT devices xfs-zoned-2024-11-25
authorChristoph Hellwig <hch@lst.de>
Sat, 23 Nov 2024 08:27:35 +0000 (09:27 +0100)
committerChristoph Hellwig <hch@lst.de>
Sun, 24 Nov 2024 13:50:31 +0000 (14:50 +0100)
Allow RT growfs when rtstart is set in the geomety, and adjust the
queried size for it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
growfs/xfs_growfs.c

index 4b941403e2fda94e6f600dba0c82cbd69d7324db..b0f5dfbdff547cdd71045257328b2b9affc53a68 100644 (file)
@@ -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,11 @@ main(int argc, char **argv)
 
        xfs_report_geom(&geo, datadev, logdev, rtdev);
 
+       if (geo.rtstart) {
+               xi.rt.size = xi.data.size - geo.rtstart;
+               xi.data.size = geo.rtstart;
+       }
+
        ddsize = xi.data.size;
        dlsize = (xi.log.size ? xi.log.size :
                        geo.logblocks * (geo.blocksize / BBSIZE) );