]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
fixup
authorChristoph Hellwig <hch@lst.de>
Mon, 5 Aug 2024 13:57:22 +0000 (15:57 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 5 Aug 2024 18:52:43 +0000 (11:52 -0700)
db/check.c
include/xfs_mount.h
libxfs/init.c
mkfs/proto.c
repair/dinode.c
repair/phase6.c
repair/rt.c

index cdb1e408e79e62bcbd0ef9d31d657851278fa3b3..9af75db538643153cdaf8b888c209edad53aefc5 100644 (file)
@@ -1964,7 +1964,7 @@ init(
 
                dbmap[c] = xcalloc(mp->m_sb.sb_rblocks, sizeof(**dbmap));
                inomap[c] = xcalloc(mp->m_sb.sb_rblocks, sizeof(**inomap));
-               words = mp->m_rsumsize >> XFS_WORDLOG;
+               words = XFS_FSB_TO_B(mp, mp->m_rsumblocks) >> XFS_WORDLOG;
                sumfile = xcalloc(words, sizeof(union xfs_suminfo_raw));
                sumcompute = xcalloc(words, sizeof(union xfs_suminfo_raw));
        }
index 0dbd1006e81487e6584d78e2c181eaad4ef6b94f..06e2f9bb1911b1282070fe56c5b9434be000c6f2 100644 (file)
@@ -50,7 +50,7 @@ typedef struct xfs_mount {
        xfs_agnumber_t          m_maxagi;       /* highest inode alloc group */
         struct xfs_ino_geometry        m_ino_geo;      /* inode geometry */
        uint                    m_rsumlevels;   /* rt summary levels */
-       uint                    m_rsumsize;     /* size of rt summary, bytes */
+       xfs_filblks_t           m_rsumblocks;   /* size of rt summary, FSBs */
        /*
         * Optional cache of rt summary level per bitmap block with the
         * invariant that m_rsum_cache[bbno] <= the minimum i for which
index 07bb0e5f02011153c7be03e46a583eceebb2f707..2d9fa0838b691f7fe2c9e489af425034f5ddc888 100644 (file)
@@ -293,7 +293,6 @@ rtmount_init(
 {
        struct xfs_buf  *bp;    /* buffer for last block of subvolume */
        xfs_daddr_t     d;      /* address of last block of subvolume */
-       unsigned int    rsumblocks;
        int             error;
 
        if (mp->m_sb.sb_rblocks == 0)
@@ -319,9 +318,8 @@ rtmount_init(
                return -1;
        }
        mp->m_rsumlevels = mp->m_sb.sb_rextslog + 1;
-       rsumblocks = xfs_rtsummary_blockcount(mp, mp->m_rsumlevels,
+       mp->m_rsumblocks = xfs_rtsummary_blockcount(mp, mp->m_rsumlevels,
                        mp->m_sb.sb_rbmblocks);
-       mp->m_rsumsize = XFS_FSB_TO_B(mp, rsumblocks);
        mp->m_rbmip = mp->m_rsumip = NULL;
 
        /*
index f51cef8bd636e8b68d18a036aa9fc9ec3172ccfe..da7bbe116e0fc9ee44c74a036678bd131bb3da29 100644 (file)
@@ -881,7 +881,7 @@ rtsummary_create(
 {
        struct xfs_mount        *mp = ip->i_mount;
 
-       ip->i_disk_size = mp->m_rsumsize;
+       ip->i_disk_size = mp->m_rsumblocks * mp->m_sb.sb_blocksize;
 
        mp->m_sb.sb_rsumino = ip->i_ino;
        mp->m_rsumip = ip;
@@ -910,7 +910,7 @@ rtfreesp_init(
                fail(_("Initialization of rtbitmap inode failed"), error);
 
        error = -libxfs_rtfile_initialize_blocks(mp->m_rsumip, 0,
-                       XFS_B_TO_FSB(mp, mp->m_rsumsize), NULL);
+                       mp->m_rsumblocks, NULL);
        if (error)
                fail(_("Initialization of rtsummary inode failed"), error);
 
index b9337c1adfc573b88df546858ac367ca7f6b6542..86e2c3622de12bc433aa1c86f87698dc22157354 100644 (file)
@@ -1770,10 +1770,11 @@ _("realtime bitmap inode %" PRIu64 " has bad size %" PRId64 " (should be %" PRIu
                break;
 
        case XR_INO_RTSUM:
-               if (size != mp->m_rsumsize)  {
+               if (size != XFS_FSB_TO_B(mp, mp->m_rsumblocks))  {
                        do_warn(
-_("realtime summary inode %" PRIu64 " has bad size %" PRId64 " (should be %d)\n"),
-                               lino, size, mp->m_rsumsize);
+_("realtime summary inode %" PRIu64 " has bad size %" PRIu64 " (should be %" PRIu64 ")\n"),
+                               lino, size,
+                               XFS_FSB_TO_B(mp, mp->m_rsumblocks));
                        return 1;
                }
                break;
index 779ea1ec5498cc38bd64d35b84e53893d53200ca..409401b86c1b76cfc2847ddcd3cfbccb433b88b9 100644 (file)
@@ -559,7 +559,7 @@ mk_rsumino(
                _("couldn't iget realtime summary inode -- error - %d\n"),
                        error);
        }
-       ip->i_disk_size = mp->m_rsumsize;
+       ip->i_disk_size = mp->m_rsumblocks * mp->m_sb.sb_blocksize;
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
        error = -libxfs_trans_commit(tp);
        if (error)
index f52012a8cc61a14922e6258cf11ec33825b2e858..b0c55470e2dd623a9e5ebb5452d970eca59c56d4 100644 (file)
@@ -63,7 +63,7 @@ generate_rtinfo(
 _("couldn't allocate memory for incore realtime bitmap.\n"));
        words = btmcompute;
 
-       wordcnt = mp->m_rsumsize >> XFS_WORDLOG;
+       wordcnt = XFS_FSB_TO_B(mp, mp->m_rsumblocks) >> XFS_WORDLOG;
        sumcompute = calloc(wordcnt, sizeof(union xfs_suminfo_raw));
        if (!sumcompute)
                do_error(
@@ -214,7 +214,7 @@ check_rtsummary(
                return;
 
        check_rtfile_contents(mp, "rtsummary", mp->m_sb.sb_rsumino, sumcompute,
-                       XFS_B_TO_FSB(mp, mp->m_rsumsize));
+                       mp->m_rsumblocks);
 }
 
 void
@@ -263,8 +263,7 @@ _("couldn't iget realtime summary inode, error - %d\n"), error);
        libxfs_trans_cancel(tp);
 
        mp->m_rsumip = ip;
-       error = -libxfs_rtfile_initialize_blocks(ip, 0,
-                       mp->m_rsumsize >> mp->m_sb.sb_blocklog,
+       error = -libxfs_rtfile_initialize_blocks(ip, 0, mp->m_rsumblocks,
                        sumcompute);
        mp->m_rsumip = NULL;
        if (error)