]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - db/check.c
xfs_{db,repair}: convert open-coded xfs_rtword_t pointer accesses to helper
[thirdparty/xfsprogs-dev.git] / db / check.c
index 6e06499b9eb34b4a3c91f44a267904785d9f3ecb..a8f6310fcd25823bc7155fb5e67109e7bbc4fc01 100644 (file)
@@ -3608,8 +3608,11 @@ process_rtbitmap(
        bitsperblock = mp->m_sb.sb_blocksize * NBBY;
        bit = extno = prevbit = start_bmbno = start_bit = 0;
        bmbno = NULLFILEOFF;
-       while ((bmbno = blkmap_next_off(blkmap, bmbno, &t)) !=
-              NULLFILEOFF) {
+       while ((bmbno = blkmap_next_off(blkmap, bmbno, &t)) != NULLFILEOFF) {
+               struct xfs_rtalloc_args args = {
+                       .mp             = mp,
+               };
+
                bno = blkmap_get(blkmap, bmbno);
                if (bno == NULLFSBLOCK) {
                        if (!sflag)
@@ -3622,7 +3625,7 @@ process_rtbitmap(
                push_cur();
                set_cur(&typtab[TYP_RTBITMAP], XFS_FSB_TO_DADDR(mp, bno), blkbb,
                        DB_RING_IGN, NULL);
-               if ((words = iocur_top->data) == NULL) {
+               if (!iocur_top->bp) {
                        if (!sflag)
                                dbprintf(_("can't read block %lld for rtbitmap "
                                         "inode\n"),
@@ -3631,6 +3634,9 @@ process_rtbitmap(
                        pop_cur();
                        continue;
                }
+
+               args.rbmbp = iocur_top->bp;
+               words = (xfs_rtword_t *)xfs_rbmblock_wordptr(&args, 0);
                for (bit = 0;
                     bit < bitsperblock && extno < mp->m_sb.sb_rextents;
                     bit++, extno++) {