From 05a574d8381b9a840f130ef5e738738d24deb2e7 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 5 Aug 2024 15:57:22 +0200 Subject: [PATCH] fixup --- db/check.c | 2 +- include/xfs_mount.h | 2 +- libxfs/init.c | 4 +--- mkfs/proto.c | 4 ++-- repair/dinode.c | 7 ++++--- repair/phase6.c | 2 +- repair/rt.c | 7 +++---- 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/db/check.c b/db/check.c index cdb1e408e..9af75db53 100644 --- a/db/check.c +++ b/db/check.c @@ -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)); } diff --git a/include/xfs_mount.h b/include/xfs_mount.h index 0dbd1006e..06e2f9bb1 100644 --- a/include/xfs_mount.h +++ b/include/xfs_mount.h @@ -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 diff --git a/libxfs/init.c b/libxfs/init.c index 07bb0e5f0..2d9fa0838 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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; /* diff --git a/mkfs/proto.c b/mkfs/proto.c index f51cef8bd..da7bbe116 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -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); diff --git a/repair/dinode.c b/repair/dinode.c index b9337c1ad..86e2c3622 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -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; diff --git a/repair/phase6.c b/repair/phase6.c index 779ea1ec5..409401b86 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -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) diff --git a/repair/rt.c b/repair/rt.c index f52012a8c..b0c55470e 100644 --- a/repair/rt.c +++ b/repair/rt.c @@ -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) -- 2.50.1