]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
mkfs: add headers to realtime bitmap blocks
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:22:11 +0000 (14:22 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 6 Aug 2024 12:53:50 +0000 (05:53 -0700)
When the rtgroups feature is enabled, format rtbitmap blocks with the
appropriate block headers.  libxfs takes care of the actual writing for
us, so all we have to do is ensure that the bitmap is the correct size.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
mkfs/xfs_mkfs.c

index 439b198a3d8cdd5f444cbea69205c0c0863fc671..0a05f65905d0027e3bdef7b447efd6ac07c61adb 100644 (file)
@@ -926,6 +926,7 @@ struct sb_feat_args {
        bool    nortalign;
        bool    nrext64;
        bool    exchrange;              /* XFS_SB_FEAT_INCOMPAT_EXCHRANGE */
+       bool    rtgroups;               /* XFS_SB_FEAT_INCOMPAT_RTGROUPS */
 };
 
 struct cli_params {
@@ -3210,6 +3211,7 @@ validate_rtdev(
        struct cli_params       *cli)
 {
        struct libxfs_init      *xi = cli->xi;
+       unsigned int            rbmblocksize = cfg->blocksize;
 
        if (!xi->rt.dev) {
                if (cli->rtsize) {
@@ -3253,8 +3255,10 @@ reported by the device (%u).\n"),
 _("cannot have an rt subvolume with zero extents\n"));
                usage();
        }
+       if (cfg->sb_feat.rtgroups)
+               rbmblocksize -= sizeof(struct xfs_rtbuf_blkinfo);
        cfg->rtbmblocks = (xfs_extlen_t)howmany(cfg->rtextents,
-                                               NBBY * cfg->blocksize);
+                                               NBBY * rbmblocksize);
 }
 
 static bool