]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_{copy,db,logprint,repair}: replace xfs_sb_version checks with feature flag checks
authorDarrick J. Wong <djwong@kernel.org>
Mon, 31 Jan 2022 22:27:44 +0000 (17:27 -0500)
committerEric Sandeen <sandeen@redhat.com>
Mon, 31 Jan 2022 22:27:44 +0000 (17:27 -0500)
Convert the xfs_sb_version_hasfoo() to checks against mp->m_features.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
37 files changed:
copy/xfs_copy.c
db/btblock.c
db/btdump.c
db/check.c
db/crc.c
db/frag.c
db/fsmap.c
db/fuzz.c
db/init.c
db/inode.c
db/io.c
db/logformat.c
db/metadump.c
db/namei.c
db/sb.c
db/timelimit.c
db/write.c
libxfs/init.c
libxfs/rdwr.c
libxfs/util.c
logprint/logprint.c
repair/agbtree.c
repair/agheader.c
repair/attr_repair.c
repair/dino_chunks.c
repair/dinode.c
repair/incore.h
repair/incore_ino.c
repair/phase2.c
repair/phase4.c
repair/phase5.c
repair/phase6.c
repair/quotacheck.c
repair/rmap.c
repair/scan.c
repair/versions.c
repair/xfs_repair.c

index 94faa6db716ccc62bf7a9dfa4f834ed950429385..2642114f59d61b8d553cf705e2459d07f472cb73 100644 (file)
@@ -526,8 +526,7 @@ sb_update_uuid(
         * we must copy the original sb_uuid to the sb_meta_uuid slot and set
         * the incompat flag for the feature on this copy.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb) &&
-           !xfs_sb_version_hasmetauuid(&mp->m_sb) &&
+       if (xfs_has_crc(mp) && !xfs_has_metauuid(mp) &&
            !uuid_equal(&tcarg->uuid, &mp->m_sb.sb_uuid)) {
                uint32_t feat;
 
@@ -542,7 +541,7 @@ sb_update_uuid(
        platform_uuid_copy(&ag_hdr->xfs_sb->sb_uuid, &tcarg->uuid);
 
        /* We may have changed the UUID, so update the superblock CRC */
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                xfs_update_cksum((char *)ag_hdr->xfs_sb, mp->m_sb.sb_sectsize,
                                XFS_SB_CRC_OFF);
 }
@@ -1043,7 +1042,7 @@ main(int argc, char **argv)
                                  pos - btree_buf.position);
 
                        if (be32_to_cpu(block->bb_magic) !=
-                           (xfs_sb_version_hascrc(&mp->m_sb) ?
+                           (xfs_has_crc(mp) ?
                             XFS_ABTB_CRC_MAGIC : XFS_ABTB_MAGIC)) {
                                do_log(_("Bad btree magic 0x%x\n"),
                                        be32_to_cpu(block->bb_magic));
@@ -1281,7 +1280,7 @@ write_log_header(int fd, wbuf *buf, xfs_mount_t *mp)
        }
 
        offset = libxfs_log_header(p, &buf->owner->uuid,
-                       xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1,
+                       xfs_has_logv2(mp) ? 2 : 1,
                        mp->m_sb.sb_logsunit, XLOG_FMT, NULLCOMMITLSN,
                        NULLCOMMITLSN, next_log_chunk, buf);
        do_write(buf->owner, NULL);
@@ -1366,7 +1365,7 @@ format_log(
         * all existing metadata LSNs are valid (behind the current LSN) on the
         * target fs.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                cycle = mp->m_log->l_curr_cycle + 1;
 
        /*
@@ -1374,7 +1373,7 @@ format_log(
         * write fails, mark the target inactive so the failure is reported.
         */
        libxfs_log_clear(NULL, buf->data, logstart, length, &buf->owner->uuid,
-                        xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1,
+                        xfs_has_logv2(mp) ? 2 : 1,
                         mp->m_sb.sb_logsunit, XLOG_FMT, cycle, true);
        if (do_write(buf->owner, buf))
                target[tcarg->id].state = INACTIVE;
@@ -1389,7 +1388,7 @@ format_logs(
        wbuf                    logbuf;
        int                     logsize;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                logsize = XFS_FSB_TO_B(mp, mp->m_sb.sb_logblocks);
                if (!wbuf_init(&logbuf, logsize, w_buf.data_align,
                               w_buf.min_io_size, w_buf.id))
@@ -1397,14 +1396,14 @@ format_logs(
        }
 
        for (i = 0, tcarg = targ; i < num_targets; i++)  {
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               if (xfs_has_crc(mp))
                        format_log(mp, tcarg, &logbuf);
                else
                        clear_log(mp, tcarg);
                tcarg++;
        }
 
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                free(logbuf.data);
 
        return 0;
index e57d5f466951b41f0197910dcc36ce675f6d957c..24c6566980f9b4f7ec2fc87fff573f4fd5466ef9 100644 (file)
@@ -120,7 +120,7 @@ block_to_bt(
        }
 
        /* Magic is invalid/unknown.  Guess based on iocur type */
-       crc = xfs_sb_version_hascrc(&mp->m_sb);
+       crc = xfs_has_crc(mp);
        switch (iocur_top->typ->typnm) {
        case TYP_BMAPBTA:
        case TYP_BMAPBTD:
index 920f595b4e6926bc3679b3a79a4636351f8f23a5..cb9ca082a6eda89a8eef292f3c54076e8a5bd822 100644 (file)
@@ -159,7 +159,7 @@ dump_inode(
 
        if (attrfork)
                prefix = "a.bmbt";
-       else if (xfs_sb_version_hascrc(&mp->m_sb))
+       else if (xfs_has_crc(mp))
                prefix = "u3.bmbt";
        else
                prefix = "u.bmbt";
@@ -448,7 +448,7 @@ btdump_f(
 {
        bool            aflag = false;
        bool            iflag = false;
-       bool            crc = xfs_sb_version_hascrc(&mp->m_sb);
+       bool            crc = xfs_has_crc(mp);
        int             c;
 
        if (cur_typ == NULL) {
index 485e855e8b7817ac3b460e876b5c273bb3efd46f..a078e948bc8f63d46147a77bb4a8c9ed5b185b35 100644 (file)
@@ -891,21 +891,21 @@ blockget_f(
                error++;
        }
        if ((sbversion & XFS_SB_VERSION_ATTRBIT) &&
-                                       !xfs_sb_version_hasattr(&mp->m_sb)) {
+                                       !xfs_has_attr(mp)) {
                if (!sflag)
                        dbprintf(_("sb versionnum missing attr bit %x\n"),
                                XFS_SB_VERSION_ATTRBIT);
                error++;
        }
        if ((sbversion & XFS_SB_VERSION_QUOTABIT) &&
-                                       !xfs_sb_version_hasquota(&mp->m_sb)) {
+                                       !xfs_has_quota(mp)) {
                if (!sflag)
                        dbprintf(_("sb versionnum missing quota bit %x\n"),
                                XFS_SB_VERSION_QUOTABIT);
                error++;
        }
        if (!(sbversion & XFS_SB_VERSION_ALIGNBIT) &&
-                                       xfs_sb_version_hasalign(&mp->m_sb)) {
+                                       xfs_has_align(mp)) {
                if (!sflag)
                        dbprintf(_("sb versionnum extra align bit %x\n"),
                                XFS_SB_VERSION_ALIGNBIT);
@@ -1628,7 +1628,7 @@ static bool
 is_reflink(
        dbm_t           type2)
 {
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return false;
        if (type2 == DBM_DATA || type2 == DBM_RLDATA)
                return true;
@@ -1988,7 +1988,7 @@ init(
         * at least one full inode record per block. Check this case explicitly.
         */
        if (mp->m_sb.sb_inoalignmt ||
-           (xfs_sb_version_hasalign(&mp->m_sb) &&
+           (xfs_has_align(mp) &&
             mp->m_sb.sb_inopblock >= XFS_INODES_PER_CHUNK))
                sbversion |= XFS_SB_VERSION_ALIGNBIT;
        if ((mp->m_sb.sb_uquotino && mp->m_sb.sb_uquotino != NULLFSINO) ||
@@ -2814,7 +2814,7 @@ process_inode(
        uid = be32_to_cpu(dip->di_uid);
        gid = be32_to_cpu(dip->di_gid);
        diflags = be16_to_cpu(dip->di_flags);
-       if (xfs_sb_version_has_v3inode(&mp->m_sb))
+       if (xfs_has_v3inodes(mp))
                diflags2 = be64_to_cpu(dip->di_flags2);
        if (isfree) {
                if (be64_to_cpu(dip->di_nblocks) != 0) {
@@ -4497,7 +4497,7 @@ scanfunc_ino(
        int                     ioff;
        struct xfs_ino_geometry *igeo = M_IGEO(mp);
 
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                blks_per_buf = igeo->blocks_per_cluster;
        else
                blks_per_buf = igeo->ialloc_blks;
@@ -4586,7 +4586,7 @@ next_buf:
                                ioff += inodes_per_buf;
                        }
 
-                       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+                       if (xfs_has_sparseinodes(mp))
                                freecount = rp[i].ir_u.sp.ir_freecount;
                        else
                                freecount = be32_to_cpu(rp[i].ir_u.f.ir_freecount);
@@ -4641,7 +4641,7 @@ scanfunc_fino(
        int                     ioff;
        struct xfs_ino_geometry *igeo = M_IGEO(mp);
 
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                blks_per_buf = igeo->blocks_per_cluster;
        else
                blks_per_buf = igeo->ialloc_blks;
index b23417a11a1e661b12829ef377ee251e8a7b503a..7428b9160a2bc06390471382df6322b2debb5160 100644 (file)
--- a/db/crc.c
+++ b/db/crc.c
@@ -29,7 +29,7 @@ static const cmdinfo_t crc_cmd =
 void
 crc_init(void)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                add_command(&crc_cmd);
 }
 
index cc00672edd08f994cef3b5946cc21f9f27fd0ebc..9bc63614c7bf1f432e639d8c9f4ed0aa41976231 100644 (file)
--- a/db/frag.c
+++ b/db/frag.c
@@ -474,7 +474,7 @@ scanfunc_ino(
        int                     ioff;
        struct xfs_ino_geometry *igeo = M_IGEO(mp);
 
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                blks_per_buf = igeo->blocks_per_cluster;
        else
                blks_per_buf = igeo->ialloc_blks;
index d30b832c4e0cfc063dda1ce2ea4d6f9322dcfebe..8e130f5b7d228ae18ce12b884ae4f488d4fd0879 100644 (file)
@@ -112,7 +112,7 @@ fsmap_f(
        xfs_fsblock_t           start_fsb = 0;
        xfs_fsblock_t           end_fsb = NULLFSBLOCK;
 
-       if (!xfs_sb_version_hasrmapbt(&mp->m_sb)) {
+       if (!xfs_has_rmapbt(mp)) {
                dbprintf(_("Filesystem does not support reverse mapping btree.\n"));
                return 0;
        }
index 65157bd08d4937ad44d7ee256ea75a93ede0504a..ba64bad7ac18ad0eecee090993f5df12e0bb2829 100644 (file)
--- a/db/fuzz.c
+++ b/db/fuzz.c
@@ -116,7 +116,7 @@ fuzz_f(
 
        if (invalid_data &&
            iocur_top->typ->crc_off == TYP_F_NO_CRC_OFF &&
-           xfs_sb_version_hascrc(&mp->m_sb)) {
+           xfs_has_crc(mp)) {
                dbprintf(_("Cannot recalculate CRCs on this type of object\n"));
                return 0;
        }
@@ -140,7 +140,7 @@ fuzz_f(
        local_ops.verify_read = stashed_ops->verify_read;
        iocur_top->bp->b_ops = &local_ops;
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (!xfs_has_crc(mp)) {
                local_ops.verify_write = xfs_dummy_verify;
        } else if (corrupt) {
                local_ops.verify_write = xfs_dummy_verify;
index 19f0900a862b3a6d4abb51d04f83fb022204230e..eec65d0884dff7eee1bd12b6e47ed660e818c100 100644 (file)
--- a/db/init.c
+++ b/db/init.c
@@ -152,7 +152,7 @@ init(
         * xfs_check needs corrected incore superblock values
         */
        if (sbp->sb_rootino != NULLFSINO &&
-           xfs_sb_version_haslazysbcount(&mp->m_sb)) {
+           xfs_has_lazysbcount(mp)) {
                int error = -libxfs_initialize_perag_data(mp, sbp->sb_agcount);
                if (error) {
                        fprintf(stderr,
@@ -161,9 +161,9 @@ init(
                }
        }
 
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                type_set_tab_spcrc();
-       else if (xfs_sb_version_hascrc(&mp->m_sb))
+       else if (xfs_has_crc(mp))
                type_set_tab_crc();
 
        push_cur();
index 3453c08907ee59fcc4fc2b5c8b7364709867e489..22bc63a8aa715ccfcf4643477856bb513c0b5069 100644 (file)
@@ -560,7 +560,7 @@ inode_u_sfdir2_count(
        ASSERT((char *)XFS_DFORK_DPTR(dip) - (char *)dip == byteize(startoff));
        return dip->di_format == XFS_DINODE_FMT_LOCAL &&
               (be16_to_cpu(dip->di_mode) & S_IFMT) == S_IFDIR &&
-              !xfs_sb_version_hasftype(&mp->m_sb);
+              !xfs_has_ftype(mp);
 }
 
 static int
@@ -576,7 +576,7 @@ inode_u_sfdir3_count(
        ASSERT((char *)XFS_DFORK_DPTR(dip) - (char *)dip == byteize(startoff));
        return dip->di_format == XFS_DINODE_FMT_LOCAL &&
               (be16_to_cpu(dip->di_mode) & S_IFMT) == S_IFDIR &&
-              xfs_sb_version_hasftype(&mp->m_sb);
+              xfs_has_ftype(mp);
 }
 
 int
@@ -691,7 +691,7 @@ set_cur_inode(
        if ((iocur_top->mode & S_IFMT) == S_IFDIR)
                iocur_top->dirino = ino;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                iocur_top->ino_crc_ok = libxfs_verify_cksum((char *)dip,
                                                    mp->m_sb.sb_inodesize,
                                                    XFS_DINODE_CRC_OFF);
diff --git a/db/io.c b/db/io.c
index c79cf1059b9e7e202a2fe3d20dd676251c084b97..98f4e60502fec76bff1a73000f9d6c59aa049f8f 100644 (file)
--- a/db/io.c
+++ b/db/io.c
@@ -477,7 +477,7 @@ write_cur(void)
                return;
        }
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb) ||
+       if (!xfs_has_crc(mp) ||
            !iocur_top->bp->b_ops ||
            iocur_top->bp->b_ops->verify_write == xfs_dummy_verify)
                skip_crc = true;
@@ -494,7 +494,7 @@ write_cur(void)
                write_cur_buf();
 
        /* If we didn't write the crc automatically, re-check inode validity */
-       if (xfs_sb_version_hascrc(&mp->m_sb) &&
+       if (xfs_has_crc(mp) &&
            skip_crc && iocur_top->ino_buf) {
                iocur_top->ino_crc_ok = libxfs_verify_cksum(iocur_top->data,
                                                mp->m_sb.sb_inodesize,
index 3374c29b2aa7cd10e67ff3f9bca124a78fbea918..38b0af1128fc183755a21f3cebfa4e5e67ce8912 100644 (file)
@@ -24,7 +24,7 @@ logformat_f(int argc, char **argv)
        int             error;
        int             c;
 
-       logversion = xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1;
+       logversion = xfs_has_logv2(mp) ? 2 : 1;
 
        while ((c = getopt(argc, argv, "c:s:")) != EOF) {
                switch (c) {
@@ -64,7 +64,7 @@ logformat_f(int argc, char **argv)
        mp->m_log->l_logBBsize = XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
        mp->m_log->l_logBBstart = XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart);
        mp->m_log->l_sectBBsize = BBSIZE;
-       if (xfs_sb_version_hassector(&mp->m_sb))
+       if (xfs_has_sector(mp))
                mp->m_log->l_sectBBsize <<= (mp->m_sb.sb_logsectlog - BBSHIFT);
        mp->m_log->l_sectBBsize = BTOBB(mp->m_log->l_sectBBsize);
 
index 96b098b0eaca727f68215d1f038e068e745bf4bc..2c649c155cae9ce6f82957919308c17d85b03001 100644 (file)
@@ -574,7 +574,7 @@ copy_rmap_btree(
        xfs_agblock_t   root;
        int             levels;
 
-       if (!xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (!xfs_has_rmapbt(mp))
                return 1;
 
        root = be32_to_cpu(agf->agf_roots[XFS_BTNUM_RMAP]);
@@ -646,7 +646,7 @@ copy_refcount_btree(
        xfs_agblock_t   root;
        int             levels;
 
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return 1;
 
        root = be32_to_cpu(agf->agf_refcount_root);
@@ -1536,13 +1536,13 @@ process_dir_data_block(
                        blp = (xfs_dir2_leaf_entry_t *)btp;
 
                end_of_data = (char *)blp - block;
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               if (xfs_has_crc(mp))
                        wantmagic = XFS_DIR3_BLOCK_MAGIC;
                else
                        wantmagic = XFS_DIR2_BLOCK_MAGIC;
        } else { /* leaf/node format */
                end_of_data = mp->m_dir_geo->fsbcount << mp->m_sb.sb_blocklog;
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               if (xfs_has_crc(mp))
                        wantmagic = XFS_DIR3_DATA_MAGIC;
                else
                        wantmagic = XFS_DIR2_DATA_MAGIC;
@@ -1664,7 +1664,7 @@ process_symlink_block(
        }
        link = iocur_top->data;
 
-       if (xfs_sb_version_hascrc(&(mp)->m_sb))
+       if (xfs_has_crc((mp)))
                link += sizeof(struct xfs_dsymlink_hdr);
 
        if (obfuscate)
@@ -1675,7 +1675,7 @@ process_symlink_block(
 
                linklen = strlen(link);
                zlen = mp->m_sb.sb_blocksize - linklen;
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               if (xfs_has_crc(mp))
                        zlen -= sizeof(struct xfs_dsymlink_hdr);
                if (zlen < mp->m_sb.sb_blocksize)
                        memset(link + linklen, 0, zlen);
@@ -2476,7 +2476,7 @@ copy_inode_chunk(
         * Also make sure that that we don't process more than the single record
         * we've been passed (large block sizes can hold multiple inode chunks).
         */
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                blks_per_buf = igeo->blocks_per_cluster;
        else
                blks_per_buf = igeo->ialloc_blks;
@@ -2509,7 +2509,7 @@ copy_inode_chunk(
        if ((mp->m_sb.sb_inopblock <= XFS_INODES_PER_CHUNK && off != 0) ||
                        (mp->m_sb.sb_inopblock > XFS_INODES_PER_CHUNK &&
                                        off % XFS_INODES_PER_CHUNK != 0) ||
-                       (xfs_sb_version_hasalign(&mp->m_sb) &&
+                       (xfs_has_align(mp) &&
                                        mp->m_sb.sb_inoalignmt != 0 &&
                                        agbno % mp->m_sb.sb_inoalignmt != 0)) {
                if (show_warnings)
@@ -2660,7 +2660,7 @@ copy_inodes(
        if (!scan_btree(agno, root, levels, TYP_INOBT, &finobt, scanfunc_ino))
                return 0;
 
-       if (xfs_sb_version_hasfinobt(&mp->m_sb)) {
+       if (xfs_has_finobt(mp)) {
                root = be32_to_cpu(agi->agi_free_root);
                levels = be32_to_cpu(agi->agi_free_level);
 
@@ -2891,8 +2891,8 @@ copy_log(void)
 
                logstart = XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart);
                logblocks = XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
-               logversion = xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1;
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               logversion = xfs_has_logv2(mp) ? 2 : 1;
+               if (xfs_has_crc(mp))
                        cycle = log.l_curr_cycle + 1;
 
                libxfs_log_clear(NULL, iocur_top->data, logstart, logblocks,
index 4e2047b21cea042a29c36a2e071b4c6d174186de..e44667a9b2f9d0959e93851576fa6f1eb5fdc673 100644 (file)
@@ -231,7 +231,7 @@ get_dstr(
        struct xfs_mount        *mp,
        uint8_t                 filetype)
 {
-       if (!xfs_sb_version_hasftype(&mp->m_sb))
+       if (!xfs_has_ftype(mp))
                return filetype_strings[XFS_DIR3_FT_UNKNOWN];
 
        if (filetype >= XFS_DIR3_FT_MAX)
diff --git a/db/sb.c b/db/sb.c
index 940019439c4e3db89f7daf99ec02cae21d56f22f..7510e00f5cfe32f32eafe2283cb92c5f40e248a9 100644 (file)
--- a/db/sb.c
+++ b/db/sb.c
@@ -266,7 +266,7 @@ sb_logzero(uuid_t *uuidp)
         * The log must always move forward on v5 superblocks. Bump it to the
         * next cycle.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                cycle = mp->m_log->l_curr_cycle + 1;
 
        dbprintf(_("Clearing log and setting UUID\n"));
@@ -275,7 +275,7 @@ sb_logzero(uuid_t *uuidp)
                        XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart),
                        (xfs_extlen_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks),
                        uuidp,
-                       xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1,
+                       xfs_has_logv2(mp) ? 2 : 1,
                        mp->m_sb.sb_logsunit, XLOG_FMT, cycle, true);
        if (error) {
                dbprintf(_("ERROR: cannot clear the log\n"));
@@ -652,57 +652,57 @@ version_string(
         * We assume the state of these features now, so macros don't exist for
         * them any more.
         */
-       if (mp->m_sb.sb_versionnum & XFS_SB_VERSION_NLINKBIT)
+       if (xfs_has_nlink(mp))
                strcat(s, ",NLINK");
        if (mp->m_sb.sb_versionnum & XFS_SB_VERSION_SHAREDBIT)
                strcat(s, ",SHARED");
        if (mp->m_sb.sb_versionnum & XFS_SB_VERSION_DIRV2BIT)
                strcat(s, ",DIRV2");
 
-       if (xfs_sb_version_hasattr(&mp->m_sb))
+       if (xfs_has_attr(mp))
                strcat(s, ",ATTR");
-       if (xfs_sb_version_hasquota(&mp->m_sb))
+       if (xfs_has_quota(mp))
                strcat(s, ",QUOTA");
-       if (xfs_sb_version_hasalign(&mp->m_sb))
+       if (xfs_has_align(mp))
                strcat(s, ",ALIGN");
-       if (xfs_sb_version_hasdalign(&mp->m_sb))
+       if (xfs_has_dalign(mp))
                strcat(s, ",DALIGN");
-       if (xfs_sb_version_haslogv2(&mp->m_sb))
+       if (xfs_has_logv2(mp))
                strcat(s, ",LOGV2");
        /* This feature is required now as well */
-       if (mp->m_sb.sb_versionnum & XFS_SB_VERSION_EXTFLGBIT)
+       if (xfs_has_extflg(mp))
                strcat(s, ",EXTFLG");
-       if (xfs_sb_version_hassector(&mp->m_sb))
+       if (xfs_has_sector(mp))
                strcat(s, ",SECTOR");
-       if (xfs_sb_version_hasasciici(&mp->m_sb))
+       if (xfs_has_asciici(mp))
                strcat(s, ",ASCII_CI");
-       if (xfs_sb_version_hasmorebits(&mp->m_sb))
+       if (mp->m_sb.sb_versionnum & XFS_SB_VERSION_MOREBITSBIT)
                strcat(s, ",MOREBITS");
-       if (xfs_sb_version_hasattr2(&mp->m_sb))
+       if (xfs_has_attr2(mp))
                strcat(s, ",ATTR2");
-       if (xfs_sb_version_haslazysbcount(&mp->m_sb))
+       if (xfs_has_lazysbcount(mp))
                strcat(s, ",LAZYSBCOUNT");
-       if (xfs_sb_version_hasprojid32(&mp->m_sb))
+       if (xfs_has_projid32(mp))
                strcat(s, ",PROJID32BIT");
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                strcat(s, ",CRC");
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                strcat(s, ",FTYPE");
-       if (xfs_sb_version_hasfinobt(&mp->m_sb))
+       if (xfs_has_finobt(mp))
                strcat(s, ",FINOBT");
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                strcat(s, ",SPARSE_INODES");
-       if (xfs_sb_version_hasmetauuid(&mp->m_sb))
+       if (xfs_has_metauuid(mp))
                strcat(s, ",META_UUID");
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (xfs_has_rmapbt(mp))
                strcat(s, ",RMAPBT");
-       if (xfs_sb_version_hasreflink(&mp->m_sb))
+       if (xfs_has_reflink(mp))
                strcat(s, ",REFLINK");
-       if (xfs_sb_version_hasinobtcounts(&mp->m_sb))
+       if (xfs_has_inobtcounts(mp))
                strcat(s, ",INOBTCNT");
-       if (xfs_sb_version_hasbigtime(&mp->m_sb))
+       if (xfs_has_bigtime(mp))
                strcat(s, ",BIGTIME");
-       if (xfs_sb_version_needsrepair(&mp->m_sb))
+       if (xfs_has_needsrepair(mp))
                strcat(s, ",NEEDSREPAIR");
        return s;
 }
@@ -769,7 +769,7 @@ version_f(
                                version = 0x0034 | XFS_SB_VERSION_LOGV2BIT;
                                break;
                        case XFS_SB_VERSION_4:
-                               if (xfs_sb_version_haslogv2(&mp->m_sb))
+                               if (xfs_has_logv2(mp))
                                        dbprintf(
                _("version 2 log format is already in use\n"));
                                else
@@ -788,7 +788,7 @@ version_f(
                        return 0;
                } else if (!strcasecmp(argv[1], "attr1")) {
 
-                       if (xfs_sb_version_hasattr2(&mp->m_sb)) {
+                       if (xfs_has_attr2(mp)) {
                                if (!(mp->m_sb.sb_features2 &=
                                                ~XFS_SB_VERSION2_ATTR2BIT))
                                        mp->m_sb.sb_versionnum &=
index 53a0a399a7f2d836619b93422d3eb917f22eafd7..7b61e980c345f4075221b978bcf74cc8e689b72b 100644 (file)
@@ -113,7 +113,7 @@ timelimit_f(
        }
 
        if (whatkind == SHOW_AUTO) {
-               if (xfs_sb_version_hasbigtime(&mp->m_sb))
+               if (xfs_has_bigtime(mp))
                        whatkind = SHOW_BIGTIME;
                else
                        whatkind = SHOW_CLASSIC;
index 0592a099bb535c8200ce909bd48e5993865c6115..70cb0518d0113a08286bae276053a9fe3d77a713 100644 (file)
@@ -127,7 +127,7 @@ write_f(
 
        if (invalid_data &&
            iocur_top->typ->crc_off == TYP_F_NO_CRC_OFF &&
-           xfs_sb_version_hascrc(&mp->m_sb)) {
+           xfs_has_crc(mp)) {
                dbprintf(_("Cannot recalculate CRCs on this type of object\n"));
                return 0;
        }
@@ -151,7 +151,7 @@ write_f(
        local_ops.verify_read = stashed_ops->verify_read;
        iocur_top->bp->b_ops = &local_ops;
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (!xfs_has_crc(mp)) {
                local_ops.verify_write = xfs_dummy_verify;
        } else if (corrupt) {
                local_ops.verify_write = xfs_dummy_verify;
index 6b44a276f84cba7a9828e30d60330229400b4c5b..b63c204dfc7226eb73b55b447dae7fcfc8164a8a 100644 (file)
@@ -743,7 +743,7 @@ libxfs_mount(
        /*
         * Set whether we're using stripe alignment.
         */
-       if (xfs_sb_version_hasdalign(&mp->m_sb)) {
+       if (xfs_has_dalign(mp)) {
                mp->m_dalign = sbp->sb_unit;
                mp->m_swidth = sbp->sb_width;
        }
@@ -796,7 +796,7 @@ libxfs_mount(
 
        xfs_da_mount(mp);
 
-       if (xfs_sb_version_hasattr2(&mp->m_sb))
+       if (xfs_has_attr2(mp))
                mp->m_flags |= LIBXFS_MOUNT_ATTR2;
 
        /* Initialize the precomputed transaction reservations values */
index a5fd0596687e3b0a167c82840d874047f4bb2ad7..5086bdbca83d27747296ddf5dbf5304b1f54335a 100644 (file)
@@ -1019,7 +1019,7 @@ xfs_verify_magic(
        struct xfs_mount        *mp = bp->b_mount;
        int                     idx;
 
-       idx = xfs_sb_version_hascrc(&mp->m_sb);
+       idx = xfs_has_crc(mp);
        if (unlikely(WARN_ON(!bp->b_ops || !bp->b_ops->magic[idx])))
                return false;
        return dmagic == bp->b_ops->magic[idx];
@@ -1038,7 +1038,7 @@ xfs_verify_magic16(
        struct xfs_mount        *mp = bp->b_mount;
        int                     idx;
 
-       idx = xfs_sb_version_hascrc(&mp->m_sb);
+       idx = xfs_has_crc(mp);
        if (unlikely(WARN_ON(!bp->b_ops || !bp->b_ops->magic16[idx])))
                return false;
        return dmagic == bp->b_ops->magic16[idx];
index 905f178479a3c005f689f304eb27a02557a696b4..9c8230cd15d3f948bca6efb81a4be3bac60cc550 100644 (file)
@@ -44,7 +44,7 @@ xfs_log_calc_unit_res(
        int                     iclog_size;
        uint                    num_headers;
 
-       if (xfs_sb_version_haslogv2(&mp->m_sb)) {
+       if (xfs_has_logv2(mp)) {
                iclog_size = XLOG_MAX_RECORD_BSIZE;
                iclog_header_size = BBTOB(iclog_size / XLOG_HEADER_CYCLE_SIZE);
        } else {
@@ -125,7 +125,7 @@ xfs_log_calc_unit_res(
        unit_bytes += iclog_header_size;
 
        /* for roundoff padding for transaction data and one for commit record */
-       if (xfs_sb_version_haslogv2(&mp->m_sb) && mp->m_sb.sb_logsunit > 1) {
+       if (xfs_has_logv2(mp) && mp->m_sb.sb_logsunit > 1) {
                /* log su roundoff */
                unit_bytes += 2 * mp->m_sb.sb_logsunit;
        } else {
@@ -226,7 +226,7 @@ xfs_inode_propagate_flags(
                }
        } else {
                if ((pip->i_diflags & XFS_DIFLAG_RTINHERIT) &&
-                   xfs_sb_version_hasrealtime(&ip->i_mount->m_sb))
+                   xfs_has_realtime(ip->i_mount))
                        di_flags |= XFS_DIFLAG_REALTIME;
                if (pip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) {
                        di_flags |= XFS_DIFLAG_EXTSIZE;
@@ -282,7 +282,7 @@ libxfs_init_new_inode(
        ip->i_extsize = pip ? 0 : fsx->fsx_extsize;
        ip->i_diflags = pip ? 0 : xfs_flags2diflags(ip, fsx->fsx_xflags);
 
-       if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
+       if (xfs_has_v3inodes(ip->i_mount)) {
                VFS_I(ip)->i_version = 1;
                ip->i_diflags2 = pip ? ip->i_mount->m_ino_geo.new_diflags2 :
                                xfs_flags2diflags2(ip, fsx->fsx_xflags);
@@ -360,7 +360,7 @@ libxfs_iflush_int(
        ASSERT(ip->i_forkoff <= mp->m_sb.sb_inodesize);
 
        /* bump the change count on v3 inodes */
-       if (xfs_sb_version_has_v3inode(&mp->m_sb))
+       if (xfs_has_v3inodes(mp))
                VFS_I(ip)->i_version++;
 
        /*
index 430961ff718ea00e34bf864e3d493fa262053457..3514d013e934b7cfe1f3edc5547a3f5a52e1d23b 100644 (file)
@@ -86,7 +86,7 @@ logstat(xfs_mount_t *mp)
                x.logBBsize = XFS_FSB_TO_BB(mp, sb->sb_logblocks);
                x.logBBstart = XFS_FSB_TO_DADDR(mp, sb->sb_logstart);
                x.lbsize = BBSIZE;
-               if (xfs_sb_version_hassector(&mp->m_sb))
+               if (xfs_has_sector(mp))
                        x.lbsize <<= (sb->sb_logsectlog - BBSHIFT);
 
                if (!x.logname && sb->sb_logstart == 0) {
index f20dc9baac62ee10cfa48172b25b021068c6bbdc..0fd7ef5d351b866cf76bd603a53803106155984d 100644 (file)
@@ -401,7 +401,7 @@ get_inobt_record(
        irec->ir_count = inocnt;
        irec->ir_freecount = finocnt;
 
-       if (xfs_sb_version_hassparseinodes(&cur->bc_mp->m_sb)) {
+       if (xfs_has_sparseinodes(cur->bc_mp)) {
                uint64_t                sparse;
                int                     spmask;
                uint16_t                holemask;
@@ -452,7 +452,7 @@ init_ino_cursors(
        bool                    finobt;
        int                     error;
 
-       finobt = xfs_sb_version_hasfinobt(&sc->mp->m_sb);
+       finobt = xfs_has_finobt(sc->mp);
        init_rebuild(sc, &XFS_RMAP_OINFO_INOBT, free_space, btr_ino);
 
        /* Compute inode statistics. */
@@ -543,7 +543,7 @@ _("Error %d while creating inobt btree for AG %u.\n"), error, agno);
        /* Since we're not writing the AGI yet, no need to commit the cursor */
        libxfs_btree_del_cursor(btr_ino->cur, 0);
 
-       if (!xfs_sb_version_hasfinobt(&sc->mp->m_sb))
+       if (!xfs_has_finobt(sc->mp))
                return;
 
        /* Add all observed finobt records. */
@@ -583,7 +583,7 @@ init_rmapbt_cursor(
        xfs_agnumber_t          agno = pag->pag_agno;
        int                     error;
 
-       if (!xfs_sb_version_hasrmapbt(&sc->mp->m_sb))
+       if (!xfs_has_rmapbt(sc->mp))
                return;
 
        init_rebuild(sc, &XFS_RMAP_OINFO_AG, free_space, btr);
@@ -654,7 +654,7 @@ init_refc_cursor(
        xfs_agnumber_t          agno = pag->pag_agno;
        int                     error;
 
-       if (!xfs_sb_version_hasreflink(&sc->mp->m_sb))
+       if (!xfs_has_reflink(sc->mp))
                return;
 
        init_rebuild(sc, &XFS_RMAP_OINFO_REFC, free_space, btr);
index fc62c03a0f489c6b013be16de50790d2514d97f8..d8f912f22bc9105f57f359d9eacccc9af64b1ac6 100644 (file)
@@ -97,7 +97,7 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, xfs_agnumber_t i)
 
        /* don't check freespace btrees -- will be checked by caller */
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb))
+       if (!xfs_has_crc(mp))
                return retval;
 
        if (platform_uuid_compare(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid)) {
@@ -176,7 +176,7 @@ verify_set_agi(xfs_mount_t *mp, xfs_agi_t *agi, xfs_agnumber_t agno)
 
        /* don't check inode btree -- will be checked by caller */
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb))
+       if (!xfs_has_crc(mp))
                return retval;
 
        if (platform_uuid_compare(&agi->agi_uuid, &mp->m_sb.sb_meta_uuid)) {
@@ -376,7 +376,7 @@ secondary_sb_whack(
         * superblocks. If it is anything other than 0 it is considered garbage
         * data beyond the valid sb and explicitly zeroed above.
         */
-       if (xfs_sb_version_haspquotino(&mp->m_sb) &&
+       if (xfs_has_pquotino(mp) &&
            sb->sb_inprogress == 1 && sb->sb_pquotino != NULLFSINO)  {
                if (!no_modify) {
                        sb->sb_pquotino = 0;
index bc3c2bef7c1635ab815f96e4450781fe708697ca..df1b519f2a9d7fcfa01adeedf86ab393d7f584e0 100644 (file)
@@ -393,7 +393,7 @@ rmtval_get(xfs_mount_t *mp, xfs_ino_t ino, blkmap_t *blkmap,
        int             hdrsize = 0;
        int             error;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                hdrsize = sizeof(struct xfs_attr3_rmt_hdr);
 
        /* ASSUMPTION: valuelen is a valid number, so use it for looping */
index c87a435d8c6aec7f82d58a67e5744d7749af43b8..6d494f2d7a44748fdd13184d2477be9ae2b4e7e5 100644 (file)
@@ -628,7 +628,7 @@ process_inode_chunk(
        if (cluster_count == 0)
                cluster_count = 1;
 
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb) &&
+       if (xfs_has_sparseinodes(mp) &&
            M_IGEO(mp)->inodes_per_cluster >= XFS_INODES_PER_HOLEMASK_BIT)
                can_punch_sparse = true;
 
index f39ab2dceb563185812aebaa5dc1f875829b6bf3..3a79e18ebdb946e7eb3424e433e2e0622a9f818f 100644 (file)
@@ -110,7 +110,7 @@ clear_dinode_core(struct xfs_mount *mp, xfs_dinode_t *dinoc, xfs_ino_t ino_num)
 {
        memset(dinoc, 0, sizeof(*dinoc));
        dinoc->di_magic = cpu_to_be16(XFS_DINODE_MAGIC);
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                dinoc->di_version = 3;
        else
                dinoc->di_version = 2;
@@ -556,7 +556,7 @@ _("%s fork in inode %" PRIu64 " claims metadata block %" PRIu64 "\n"),
                        case XR_E_INUSE:
                        case XR_E_MULT:
                                if (type == XR_INO_DATA &&
-                                   xfs_sb_version_hasreflink(&mp->m_sb))
+                                   xfs_has_reflink(mp))
                                        break;
                                do_warn(
 _("%s fork in %s inode %" PRIu64 " claims used block %" PRIu64 "\n"),
@@ -725,7 +725,7 @@ get_agino_buf(
        }
 
        *dipp = xfs_make_iptr(mp, bp, agino - cluster_agino);
-       ASSERT(!xfs_sb_version_hascrc(&mp->m_sb) ||
+       ASSERT(!xfs_has_crc(mp) ||
                        XFS_AGINO_TO_INO(mp, agno, agino) ==
                        be64_to_cpu((*dipp)->di_ino));
        return bp;
@@ -771,7 +771,7 @@ process_btinode(
        *tot = 0;
        *nex = 0;
 
-       magic = xfs_sb_version_hascrc(&mp->m_sb) ? XFS_BMAP_CRC_MAGIC
+       magic = xfs_has_crc(mp) ? XFS_BMAP_CRC_MAGIC
                                                 : XFS_BMAP_MAGIC;
 
        level = be16_to_cpu(dib->bb_level);
@@ -1164,7 +1164,7 @@ _("cannot read inode %" PRIu64 ", file block %" PRIu64 ", disk block %" PRIu64 "
                        int             bad_dqb = 0;
 
                        /* We only print the first problem we find */
-                       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+                       if (xfs_has_crc(mp)) {
                                if (!libxfs_verify_cksum((char *)dqb,
                                                        sizeof(*dqb),
                                                        XFS_DQUOT_CRC_OFF)) {
@@ -1288,7 +1288,7 @@ _("Bad symlink buffer CRC, block %" PRIu64 ", inode %" PRIu64 ".\n"
                byte_cnt = min(pathlen, byte_cnt);
 
                src = bp->b_addr;
-               if (xfs_sb_version_hascrc(&mp->m_sb)) {
+               if (xfs_has_crc(mp)) {
                        if (!libxfs_symlink_hdr_ok(lino, offset,
                                                   byte_cnt, bp)) {
                                do_warn(
@@ -2297,7 +2297,7 @@ process_dinode_int(xfs_mount_t *mp,
         * Of course if we make any modifications after this, the inode gets
         * rewritten, and the CRC is updated automagically.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb) &&
+       if (xfs_has_crc(mp) &&
            !libxfs_verify_cksum((char *)dino, mp->m_sb.sb_inodesize,
                                XFS_DINODE_CRC_OFF)) {
                retval = 1;
@@ -2339,7 +2339,7 @@ process_dinode_int(xfs_mount_t *mp,
                        if (!no_modify) {
                                do_warn(_(" resetting version number\n"));
                                dino->di_version =
-                                       xfs_sb_version_hascrc(&mp->m_sb) ? 3 : 2;
+                                       xfs_has_crc(mp) ? 3 : 2;
                                *dirty = 1;
                        } else
                                do_warn(_(" would reset version number\n"));
@@ -2368,7 +2368,7 @@ process_dinode_int(xfs_mount_t *mp,
         * we are called here that the inode has not already been modified in
         * memory and hence invalidated the CRC.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                if (be64_to_cpu(dino->di_ino) != lino) {
                        if (!uncertain)
                                do_warn(
@@ -2573,7 +2573,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
                }
 
                if ((flags2 & XFS_DIFLAG2_REFLINK) &&
-                   !xfs_sb_version_hasreflink(&mp->m_sb)) {
+                   !xfs_has_reflink(mp)) {
                        if (!uncertain) {
                                do_warn(
        _("inode %" PRIu64 " is marked reflinked but file system does not support reflink\n"),
@@ -2605,7 +2605,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
                }
 
                if ((flags2 & XFS_DIFLAG2_COWEXTSIZE) &&
-                   !xfs_sb_version_hasreflink(&mp->m_sb)) {
+                   !xfs_has_reflink(mp)) {
                        if (!uncertain) {
                                do_warn(
        _("inode %" PRIu64 " has CoW extent size hint but file system does not support reflink\n"),
@@ -2637,7 +2637,7 @@ _("bad (negative) size %" PRId64 " on inode %" PRIu64 "\n"),
                }
 
                if (xfs_dinode_has_bigtime(dino) &&
-                   !xfs_sb_version_hasbigtime(&mp->m_sb)) {
+                   !xfs_has_bigtime(mp)) {
                        if (!uncertain) {
                                do_warn(
        _("inode %" PRIu64 " is marked bigtime but file system does not support large timestamps\n"),
index d64315fd25853709a202452358faebe064b44423..65c03ddec9a9a5356759738130825c791d6ba1e7 100644 (file)
@@ -647,7 +647,7 @@ inorec_get_freecount(
        struct xfs_mount        *mp,
        struct xfs_inobt_rec    *rp)
 {
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                return rp->ir_u.sp.ir_freecount;
        return be32_to_cpu(rp->ir_u.f.ir_freecount);
 }
@@ -658,7 +658,7 @@ inorec_set_freecount(
        struct xfs_inobt_rec    *rp,
        int                     freecount)
 {
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (xfs_has_sparseinodes(mp))
                rp->ir_u.sp.ir_freecount = freecount;
        else
                rp->ir_u.f.ir_freecount = cpu_to_be32(freecount);
index 299e4f949e5ec1987a27c935dddfb20731af63d1..0dd7a2f060fb40b274f5e2f4272278804f654448 100644 (file)
@@ -211,7 +211,7 @@ alloc_ftypes_array(
 {
        uint8_t         *ptr;
 
-       if (!xfs_sb_version_hasftype(&mp->m_sb))
+       if (!xfs_has_ftype(mp))
                return NULL;
 
        ptr = calloc(XFS_INODES_PER_CHUNK, sizeof(*ptr));
index f13f785b31b69f8cfb802ad8aba5554b322e8e56..bda834de0b89e2af23bdca063d2ad30cb5a761d8 100644 (file)
@@ -34,7 +34,7 @@ zero_log(
        x.logBBsize = XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
        x.logBBstart = XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart);
        x.lbsize = BBSIZE;
-       if (xfs_sb_version_hassector(&mp->m_sb))
+       if (xfs_has_sector(mp))
                x.lbsize <<= (mp->m_sb.sb_logsectlog - BBSHIFT);
 
        log->l_dev = mp->m_logdev_targp;
@@ -42,13 +42,13 @@ zero_log(
        log->l_logBBstart = x.logBBstart;
        log->l_sectBBsize  = BTOBB(x.lbsize);
        log->l_mp = mp;
-       if (xfs_sb_version_hassector(&mp->m_sb)) {
+       if (xfs_has_sector(mp)) {
                log->l_sectbb_log = mp->m_sb.sb_logsectlog - BBSHIFT;
                ASSERT(log->l_sectbb_log <= mp->m_sectbb_log);
                /* for larger sector sizes, must have v2 or external log */
                ASSERT(log->l_sectbb_log == 0 ||
                        log->l_logBBstart == 0 ||
-                       xfs_sb_version_haslogv2(&mp->m_sb));
+                       xfs_has_logv2(mp));
                ASSERT(mp->m_sb.sb_logsectlog >= BBSHIFT);
        }
        log->l_sectbb_mask = (1 << log->l_sectbb_log) - 1;
@@ -111,7 +111,7 @@ zero_log(
                        XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart),
                        (xfs_extlen_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks),
                        &mp->m_sb.sb_uuid,
-                       xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1,
+                       xfs_has_logv2(mp) ? 2 : 1,
                        mp->m_sb.sb_logsunit, XLOG_FMT, XLOG_INIT_CYCLE, true);
 
                /* update the log data structure with new state */
@@ -127,7 +127,7 @@ zero_log(
         * Finally, seed the max LSN from the current state of the log if this
         * is a v5 filesystem.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                libxfs_max_lsn = atomic64_read(&log->l_last_sync_lsn);
 }
 
@@ -135,19 +135,19 @@ static bool
 set_inobtcount(
        struct xfs_mount        *mp)
 {
-       if (!xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (!xfs_has_crc(mp)) {
                printf(
        _("Inode btree count feature only supported on V5 filesystems.\n"));
                exit(0);
        }
 
-       if (!xfs_sb_version_hasfinobt(&mp->m_sb)) {
+       if (!xfs_has_finobt(mp)) {
                printf(
        _("Inode btree count feature requires free inode btree.\n"));
                exit(0);
        }
 
-       if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) {
+       if (xfs_has_inobtcounts(mp)) {
                printf(_("Filesystem already has inode btree counts.\n"));
                exit(0);
        }
@@ -162,13 +162,13 @@ static bool
 set_bigtime(
        struct xfs_mount        *mp)
 {
-       if (!xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (!xfs_has_crc(mp)) {
                printf(
        _("Large timestamp feature only supported on V5 filesystems.\n"));
                exit(0);
        }
 
-       if (xfs_sb_version_hasbigtime(&mp->m_sb)) {
+       if (xfs_has_bigtime(mp)) {
                printf(_("Filesystem already supports large timestamps.\n"));
                exit(0);
        }
index eb0430020d6404f610414fac739f84deb9ea24a7..2260f6a310ebe471fb078893f08a4357a059e507 100644 (file)
@@ -240,7 +240,7 @@ process_rmap_data(
                queue_work(&wq, check_rmap_btrees, i, NULL);
        destroy_work_queue(&wq);
 
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return;
 
        create_work_queue(&wq, mp, platform_nproc());
index 79a8dbc20334bfa6f4bb369974fc5670b55e163e..74b1dcb93b9e8bc5ed170f8f0cd3862844124a97 100644 (file)
@@ -162,17 +162,17 @@ build_agi(
        for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++)
                agi->agi_unlinked[i] = cpu_to_be32(NULLAGINO);
 
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                platform_uuid_copy(&agi->agi_uuid, &mp->m_sb.sb_meta_uuid);
 
-       if (xfs_sb_version_hasfinobt(&mp->m_sb)) {
+       if (xfs_has_finobt(mp)) {
                agi->agi_free_root =
                                cpu_to_be32(btr_fino->newbt.afake.af_root);
                agi->agi_free_level =
                                cpu_to_be32(btr_fino->newbt.afake.af_levels);
        }
 
-       if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) {
+       if (xfs_has_inobtcounts(mp)) {
                agi->agi_iblocks = cpu_to_be32(btr_ino->newbt.afake.af_blocks);
                agi->agi_fblocks = cpu_to_be32(btr_fino->newbt.afake.af_blocks);
        }
@@ -265,7 +265,7 @@ build_agf_agfl(
                        cpu_to_be32(btr_cnt->newbt.afake.af_levels);
        agf->agf_freeblks = cpu_to_be32(btr_bno->freeblks);
 
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
+       if (xfs_has_rmapbt(mp)) {
                agf->agf_roots[XFS_BTNUM_RMAP] =
                                cpu_to_be32(btr_rmap->newbt.afake.af_root);
                agf->agf_levels[XFS_BTNUM_RMAP] =
@@ -274,7 +274,7 @@ build_agf_agfl(
                                cpu_to_be32(btr_rmap->newbt.afake.af_blocks);
        }
 
-       if (xfs_sb_version_hasreflink(&mp->m_sb)) {
+       if (xfs_has_reflink(mp)) {
                agf->agf_refcount_root =
                                cpu_to_be32(btr_refc->newbt.afake.af_root);
                agf->agf_refcount_level =
@@ -286,7 +286,7 @@ build_agf_agfl(
        /*
         * Count and record the number of btree blocks consumed if required.
         */
-       if (xfs_sb_version_haslazysbcount(&mp->m_sb)) {
+       if (xfs_has_lazysbcount(mp)) {
                unsigned int blks;
                /*
                 * Don't count the root blocks as they are already
@@ -294,7 +294,7 @@ build_agf_agfl(
                 */
                blks = btr_bno->newbt.afake.af_blocks +
                        btr_cnt->newbt.afake.af_blocks - 2;
-               if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+               if (xfs_has_rmapbt(mp))
                        blks += btr_rmap->newbt.afake.af_blocks - 1;
                agf->agf_btreeblks = cpu_to_be32(blks);
 #ifdef XR_BLD_FREE_TRACE
@@ -311,7 +311,7 @@ build_agf_agfl(
                        XFS_BTNUM_CNT);
 #endif
 
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                platform_uuid_copy(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid);
 
        /* initialise the AGFL, then fill it if there are blocks left over. */
@@ -327,7 +327,7 @@ build_agf_agfl(
        /* setting to 0xff results in initialisation to NULLAGBLOCK */
        memset(agfl, 0xff, mp->m_sb.sb_sectsize);
        freelist = xfs_buf_to_agfl_bno(agfl_buf);
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                agfl->agfl_magicnum = cpu_to_be32(XFS_AGFL_MAGIC);
                agfl->agfl_seqno = cpu_to_be32(agno);
                platform_uuid_copy(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid);
@@ -340,7 +340,7 @@ build_agf_agfl(
        freelist = xfs_buf_to_agfl_bno(agfl_buf);
        fill_agfl(btr_bno, freelist, &agfl_idx);
        fill_agfl(btr_cnt, freelist, &agfl_idx);
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (xfs_has_rmapbt(mp))
                fill_agfl(btr_rmap, freelist, &agfl_idx);
 
        /* Set the AGF counters for the AGFL. */
@@ -538,12 +538,12 @@ _("unable to rebuild AG %u.  Not enough free space in on-disk AG.\n"),
 #endif
        ASSERT(btr_bno.freeblks == btr_cnt.freeblks);
 
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
+       if (xfs_has_rmapbt(mp)) {
                build_rmap_tree(&sc, agno, &btr_rmap);
                sb_fdblocks_ag[agno] += btr_rmap.newbt.afake.af_blocks - 1;
        }
 
-       if (xfs_sb_version_hasreflink(&mp->m_sb))
+       if (xfs_has_reflink(mp))
                build_refcount_tree(&sc, agno, &btr_refc);
 
        /*
@@ -563,11 +563,11 @@ _("unable to rebuild AG %u.  Not enough free space in on-disk AG.\n"),
        finish_rebuild(mp, &btr_bno, lost_blocks);
        finish_rebuild(mp, &btr_cnt, lost_blocks);
        finish_rebuild(mp, &btr_ino, lost_blocks);
-       if (xfs_sb_version_hasfinobt(&mp->m_sb))
+       if (xfs_has_finobt(mp))
                finish_rebuild(mp, &btr_fino, lost_blocks);
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (xfs_has_rmapbt(mp))
                finish_rebuild(mp, &btr_rmap, lost_blocks);
-       if (xfs_sb_version_hasreflink(&mp->m_sb))
+       if (xfs_has_reflink(mp))
                finish_rebuild(mp, &btr_refc, lost_blocks);
 
        /*
index 696a6427b8411a544caaecd3f74231c5decb336b..647dc1c5ffb4ec95de38625c6ffd1b87e0aaa348 100644 (file)
@@ -505,7 +505,7 @@ mk_rbmino(xfs_mount_t *mp)
        set_nlink(VFS_I(ip), 1);        /* account for sb ptr */
 
        times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
-       if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
+       if (xfs_has_v3inodes(mp)) {
                VFS_I(ip)->i_version = 1;
                ip->i_diflags2 = 0;
                times |= XFS_ICHGTIME_CREATE;
@@ -745,7 +745,7 @@ mk_rsumino(xfs_mount_t *mp)
        set_nlink(VFS_I(ip), 1);        /* account for sb ptr */
 
        times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
-       if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
+       if (xfs_has_v3inodes(mp)) {
                VFS_I(ip)->i_version = 1;
                ip->i_diflags2 = 0;
                times |= XFS_ICHGTIME_CREATE;
@@ -844,7 +844,7 @@ mk_root_dir(xfs_mount_t *mp)
        set_nlink(VFS_I(ip), 2);        /* account for . and .. */
 
        times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD;
-       if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
+       if (xfs_has_v3inodes(mp)) {
                VFS_I(ip)->i_version = 1;
                ip->i_diflags2 = 0;
                times |= XFS_ICHGTIME_CREATE;
@@ -1474,13 +1474,13 @@ longform_dir2_entry_check_data(
                endptr = (char *)blp;
                if (endptr > (char *)btp)
                        endptr = (char *)btp;
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               if (xfs_has_crc(mp))
                        wantmagic = XFS_DIR3_BLOCK_MAGIC;
                else
                        wantmagic = XFS_DIR2_BLOCK_MAGIC;
        } else {
                endptr = (char *)d + mp->m_dir_geo->blksize;
-               if (xfs_sb_version_hascrc(&mp->m_sb))
+               if (xfs_has_crc(mp))
                        wantmagic = XFS_DIR3_DATA_MAGIC;
                else
                        wantmagic = XFS_DIR2_DATA_MAGIC;
@@ -1787,7 +1787,7 @@ longform_dir2_entry_check_data(
                        continue;
 
                /* validate ftype field if supported */
-               if (xfs_sb_version_hasftype(&mp->m_sb)) {
+               if (xfs_has_ftype(mp)) {
                        uint8_t dir_ftype;
                        uint8_t ino_ftype;
 
@@ -2684,7 +2684,7 @@ _("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
                }
 
                /* validate ftype field if supported */
-               if (xfs_sb_version_hasftype(&mp->m_sb)) {
+               if (xfs_has_ftype(mp)) {
                        uint8_t dir_ftype;
                        uint8_t ino_ftype;
 
index 5e007a180c57fff5e50e5e60d48da68f8858ea3a..758160d3176e6db52a88b2dc9a8c6092053179de 100644 (file)
@@ -252,7 +252,7 @@ qc_dquot_check_type(
         * expect an exact match for user dquots and for non-root group and
         * project dquots.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb) || type == XFS_DQTYPE_USER || id)
+       if (xfs_has_crc(mp) || type == XFS_DQTYPE_USER || id)
                return ddq_type == type;
 
        /*
@@ -325,7 +325,7 @@ qc_check_dquot(
        }
 
        if ((ddq->d_type & XFS_DQTYPE_BIGTIME) &&
-           !xfs_sb_version_hasbigtime(&mp->m_sb)) {
+           !xfs_has_bigtime(mp)) {
                do_warn(
        _("%s id %u is marked bigtime but file system does not support large timestamps\n"),
                                qflags_typestr(dquots->type), id);
index 12fe7442b6fdff0335494ee731602e1bfd31202b..e48f6c1e39b91f0ea0f5085c4019742b250f27a7 100644 (file)
@@ -49,8 +49,8 @@ bool
 rmap_needs_work(
        struct xfs_mount        *mp)
 {
-       return xfs_sb_version_hasreflink(&mp->m_sb) ||
-              xfs_sb_version_hasrmapbt(&mp->m_sb);
+       return xfs_has_reflink(mp) ||
+              xfs_has_rmapbt(mp);
 }
 
 /*
@@ -387,7 +387,7 @@ rmap_add_fixed_ag_rec(
        /* inodes */
        ino_rec = findfirst_inode_rec(agno);
        for (; ino_rec != NULL; ino_rec = next_ino_rec(ino_rec)) {
-               if (xfs_sb_version_hassparseinodes(&mp->m_sb)) {
+               if (xfs_has_sparseinodes(mp)) {
                        startidx = find_first_zero_bit(ino_rec->ir_sparse);
                        nr = XFS_INODES_PER_CHUNK - popcnt(ino_rec->ir_sparse);
                } else {
@@ -455,7 +455,7 @@ rmap_store_ag_btree_rec(
        struct bitmap           *own_ag_bitmap = NULL;
        int                     error = 0;
 
-       if (!xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (!xfs_has_rmapbt(mp))
                return 0;
 
        /* Release the ar_rmaps; they were put into the rmapbt during p5. */
@@ -761,7 +761,7 @@ compute_refcounts(
        size_t                  old_stack_nr;
        int                     error;
 
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return 0;
 
        rmaps = ag_rmaps[agno].ar_rmaps;
@@ -988,7 +988,7 @@ rmaps_verify_btree(
        int                     have;
        int                     error;
 
-       if (!xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (!xfs_has_rmapbt(mp))
                return 0;
        if (rmapbt_suspect) {
                if (no_modify && agno == 0)
@@ -1025,7 +1025,7 @@ rmaps_verify_btree(
                 * the regular lookup doesn't find anything or if it doesn't
                 * match the observed rmap.
                 */
-               if (xfs_sb_version_hasreflink(&bt_cur->bc_mp->m_sb) &&
+               if (xfs_has_reflink(bt_cur->bc_mp) &&
                                (!have || !rmap_is_good(rm_rec, &tmp))) {
                        error = rmap_lookup_overlapped(bt_cur, rm_rec,
                                        &tmp, &have);
@@ -1350,7 +1350,7 @@ check_refcounts(
        int                             i;
        int                             error;
 
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return 0;
        if (refcbt_suspect) {
                if (no_modify && agno == 0)
index 52de8a04c8bfead5bd53fb710abc50e5d0de843b..909c4494c24a816ba7d87832432e7e911c4e8906 100644 (file)
@@ -806,7 +806,7 @@ ino_issparse(
        struct xfs_inobt_rec    *rp,
        int                     offset)
 {
-       if (!xfs_sb_version_hassparseinodes(&mp->m_sb))
+       if (!xfs_has_sparseinodes(mp))
                return false;
 
        return xfs_inobt_is_sparse_disk(rp, offset);
@@ -908,7 +908,7 @@ _("in use block (%d,%d-%d) mismatch in %s tree, state - %d,%" PRIx64 "\n"),
                 * multiple inode owners are ok with
                 * reflink enabled
                 */
-               if (xfs_sb_version_hasreflink(&mp->m_sb) &&
+               if (xfs_has_reflink(mp) &&
                    !XFS_RMAP_NON_INODE_OWNER(owner))
                        break;
                fallthrough;
@@ -1125,7 +1125,7 @@ advance:
                        } else {
                                bool bad;
 
-                               if (xfs_sb_version_hasreflink(&mp->m_sb))
+                               if (xfs_has_reflink(mp))
                                        bad = !rmap_in_order(b, laststartblock,
                                                        owner, lastowner,
                                                        offset, lastoffset);
@@ -1762,7 +1762,7 @@ _("ir_freecount/free mismatch, inode chunk %d/%u, freecount %d nfree %d\n"),
        }
 
        /* verify sparse record formats have a valid inode count */
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb) &&
+       if (xfs_has_sparseinodes(mp) &&
            ninodes != rp->ir_u.sp.ir_count) {
                do_warn(
 _("invalid inode count, inode chunk %d/%u, count %d ninodes %d\n"),
@@ -1938,7 +1938,7 @@ _("finobt record with no free inodes, inode chunk %d/%u\n"), agno, ino);
        }
 
        /* verify sparse record formats have a valid inode count */
-       if (xfs_sb_version_hassparseinodes(&mp->m_sb) &&
+       if (xfs_has_sparseinodes(mp) &&
            ninodes != rp->ir_u.sp.ir_count) {
                do_warn(
 _("invalid inode count, inode chunk %d/%u, count %d ninodes %d\n"),
@@ -2104,7 +2104,7 @@ _("%sbt btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
                                 * ir_count holds the inode count for all
                                 * records on fs' with sparse inode support
                                 */
-                               if (xfs_sb_version_hassparseinodes(&mp->m_sb))
+                               if (xfs_has_sparseinodes(mp))
                                        icount = rp[i].ir_u.sp.ir_count;
 
                                agcnts->agicount += icount;
@@ -2264,7 +2264,7 @@ validate_agf(
 
        bno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_BNO]);
        if (libxfs_verify_agbno(mp, agno, bno)) {
-               magic = xfs_sb_version_hascrc(&mp->m_sb) ? XFS_ABTB_CRC_MAGIC
+               magic = xfs_has_crc(mp) ? XFS_ABTB_CRC_MAGIC
                                                         : XFS_ABTB_MAGIC;
                scan_sbtree(bno, be32_to_cpu(agf->agf_levels[XFS_BTNUM_BNO]),
                            agno, 0, scan_allocbt, 1, magic, agcnts,
@@ -2276,7 +2276,7 @@ validate_agf(
 
        bno = be32_to_cpu(agf->agf_roots[XFS_BTNUM_CNT]);
        if (libxfs_verify_agbno(mp, agno, bno)) {
-               magic = xfs_sb_version_hascrc(&mp->m_sb) ? XFS_ABTC_CRC_MAGIC
+               magic = xfs_has_crc(mp) ? XFS_ABTC_CRC_MAGIC
                                                         : XFS_ABTC_MAGIC;
                scan_sbtree(bno, be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNT]),
                            agno, 0, scan_allocbt, 1, magic, agcnts,
@@ -2286,7 +2286,7 @@ validate_agf(
                        bno, agno);
        }
 
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
+       if (xfs_has_rmapbt(mp)) {
                struct rmap_priv        priv;
                unsigned int            levels;
 
@@ -2319,7 +2319,7 @@ validate_agf(
                }
        }
 
-       if (xfs_sb_version_hasreflink(&mp->m_sb)) {
+       if (xfs_has_reflink(mp)) {
                unsigned int    levels;
 
                levels = be32_to_cpu(agf->agf_refcount_level);
@@ -2358,7 +2358,7 @@ validate_agf(
                        be32_to_cpu(agf->agf_longest), agcnts->agflongest, agno);
        }
 
-       if (xfs_sb_version_haslazysbcount(&mp->m_sb) &&
+       if (xfs_has_lazysbcount(mp) &&
            be32_to_cpu(agf->agf_btreeblks) != agcnts->agfbtreeblks) {
                do_warn(_("agf_btreeblks %u, counted %" PRIu64 " in ag %u\n"),
                        be32_to_cpu(agf->agf_btreeblks), agcnts->agfbtreeblks, agno);
@@ -2381,7 +2381,7 @@ validate_agi(
 
        bno = be32_to_cpu(agi->agi_root);
        if (libxfs_verify_agbno(mp, agno, bno)) {
-               magic = xfs_sb_version_hascrc(&mp->m_sb) ? XFS_IBT_CRC_MAGIC
+               magic = xfs_has_crc(mp) ? XFS_IBT_CRC_MAGIC
                                                         : XFS_IBT_MAGIC;
                scan_sbtree(bno, be32_to_cpu(agi->agi_level),
                            agno, 0, scan_inobt, 1, magic, &priv,
@@ -2391,10 +2391,10 @@ validate_agi(
                        be32_to_cpu(agi->agi_root), agno);
        }
 
-       if (xfs_sb_version_hasfinobt(&mp->m_sb)) {
+       if (xfs_has_finobt(mp)) {
                bno = be32_to_cpu(agi->agi_free_root);
                if (libxfs_verify_agbno(mp, agno, bno)) {
-                       magic = xfs_sb_version_hascrc(&mp->m_sb) ?
+                       magic = xfs_has_crc(mp) ?
                                        XFS_FIBT_CRC_MAGIC : XFS_FIBT_MAGIC;
                        scan_sbtree(bno, be32_to_cpu(agi->agi_free_level),
                                    agno, 0, scan_inobt, 1, magic, &priv,
@@ -2405,7 +2405,7 @@ validate_agi(
                }
        }
 
-       if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) {
+       if (xfs_has_inobtcounts(mp)) {
                if (be32_to_cpu(agi->agi_iblocks) != priv.ino_blocks)
                        do_warn(_("bad inobt block count %u, saw %u\n"),
                                        be32_to_cpu(agi->agi_iblocks),
@@ -2426,7 +2426,7 @@ validate_agi(
                        be32_to_cpu(agi->agi_freecount), agcnts->agifreecount, agno);
        }
 
-       if (xfs_sb_version_hasfinobt(&mp->m_sb) &&
+       if (xfs_has_finobt(mp) &&
            be32_to_cpu(agi->agi_freecount) != agcnts->fibtfreecount) {
                do_warn(_("agi_freecount %u, counted %u in ag %u finobt\n"),
                        be32_to_cpu(agi->agi_freecount), agcnts->fibtfreecount,
index 0b5376d74de463068a84c6428a616289ecfaa85c..b24965b263a1836d645b54e2ff69bafc92a477ae 100644 (file)
@@ -33,10 +33,10 @@ void
 update_sb_version(
        struct xfs_mount        *mp)
 {
-       if (fs_attributes && !xfs_sb_version_hasattr(&mp->m_sb))
+       if (fs_attributes && !xfs_has_attr(mp))
                xfs_sb_version_addattr(&mp->m_sb);
 
-       if (fs_attributes2 && !xfs_sb_version_hasattr2(&mp->m_sb))
+       if (fs_attributes2 && !xfs_has_attr2(mp))
                xfs_sb_version_addattr2(&mp->m_sb);
 
        /* V2 inode conversion is now always going to happen */
@@ -49,7 +49,7 @@ update_sb_version(
         * have quotas.
         */
        if (fs_quotas)  {
-               if (!xfs_sb_version_hasquota(&mp->m_sb))
+               if (!xfs_has_quota(mp))
                        xfs_sb_version_addquota(&mp->m_sb);
 
                /*
@@ -74,13 +74,13 @@ update_sb_version(
        } else  {
                mp->m_sb.sb_qflags = 0;
 
-               if (xfs_sb_version_hasquota(&mp->m_sb))  {
+               if (xfs_has_quota(mp))  {
                        lost_quotas = 1;
                        mp->m_sb.sb_versionnum &= ~XFS_SB_VERSION_QUOTABIT;
                }
        }
 
-       if (!fs_aligned_inodes && xfs_sb_version_hasalign(&mp->m_sb))
+       if (!fs_aligned_inodes && xfs_has_align(mp))
                mp->m_sb.sb_versionnum &= ~XFS_SB_VERSION_ALIGNBIT;
 
        mp->m_features &= ~(XFS_FEAT_QUOTA | XFS_FEAT_ALIGN);
@@ -142,10 +142,10 @@ _("Superblock has unknown compat/rocompat/incompat features (0x%x/0x%x/0x%x).\n"
                return 1;
        }
 
-       if (xfs_sb_version_hasattr(&mp->m_sb))
+       if (xfs_has_attr(mp))
                fs_attributes = 1;
 
-       if (xfs_sb_version_hasattr2(&mp->m_sb))
+       if (xfs_has_attr2(mp))
                fs_attributes2 = 1;
 
        if (!(mp->m_sb.sb_versionnum & XFS_SB_VERSION_NLINKBIT)) {
@@ -162,7 +162,7 @@ _("WARNING: you have a V1 inode filesystem. It would be converted to a\n"
                }
        }
 
-       if (xfs_sb_version_hasquota(&mp->m_sb))  {
+       if (xfs_has_quota(mp))  {
                fs_quotas = 1;
 
                if (mp->m_sb.sb_uquotino != 0 && mp->m_sb.sb_uquotino != NULLFSINO)
@@ -175,7 +175,7 @@ _("WARNING: you have a V1 inode filesystem. It would be converted to a\n"
                        have_pquotino = 1;
        }
 
-       if (xfs_sb_version_hasalign(&mp->m_sb))  {
+       if (xfs_has_align(mp))  {
                fs_aligned_inodes = 1;
                fs_ino_alignment = mp->m_sb.sb_inoalignmt;
        }
index 7a142ceb2c6aba4ee09fe70995ff6071936fb2bc..abde6fe88320eb86b161e41d48e81f4f2538ad4a 100644 (file)
@@ -640,7 +640,7 @@ format_log_max_lsn(
        xfs_daddr_t             logblocks;
        int                     logversion;
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb))
+       if (!xfs_has_crc(mp))
                return;
 
        /*
@@ -660,7 +660,7 @@ format_log_max_lsn(
        new_cycle = max_cycle + 3;
        logstart = XFS_FSB_TO_DADDR(mp, mp->m_sb.sb_logstart);
        logblocks = XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks);
-       logversion = xfs_sb_version_haslogv2(&mp->m_sb) ? 2 : 1;
+       logversion = xfs_has_logv2(mp) ? 2 : 1;
 
        do_warn(_("Maximum metadata LSN (%d:%d) is ahead of log (%d:%d).\n"),
                max_cycle, max_block, log->l_curr_cycle, log->l_curr_block);
@@ -793,7 +793,7 @@ force_needsrepair(
        struct xfs_buf          *bp;
        int                     error;
 
-       if (!xfs_sb_version_hascrc(&mp->m_sb) ||
+       if (!xfs_has_crc(mp) ||
            xfs_sb_version_needsrepair(&mp->m_sb))
                return;
 
@@ -982,7 +982,7 @@ main(int argc, char **argv)
                mp->m_flags |= LIBXFS_MOUNT_WANT_CORRUPTED;
 
        /* Capture the first writeback so that we can set needsrepair. */
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                mp->m_buf_writeback_fn = repair_capture_writeback;
 
        /*