]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: convert xfs_sb_version_has checks to use mount features
authorDave Chinner <dchinner@redhat.com>
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)
Source kernel commit: ebd9027d088b3a4e49d294f79e6cadb7b7a88b28

This is a conversion of the remaining xfs_sb_version_has..(sbp)
checks to use xfs_has_..(mp) feature checks.

This was largely done with a vim replacement macro that did:

:0,$s/xfs_sb_version_has\(.*\)&\(.*\)->m_sb/xfs_has_\1\2/g<CR>

A couple of other variants were also used, and the rest touched up
by hand.

$ size -t fs/xfs/built-in.a
text    data     bss     dec     hex filename
before  1127533  311352     484 1439369  15f689 (TOTALS)
after   1125360  311352     484 1437196  15ee0c (TOTALS)

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
24 files changed:
libxfs/xfs_ag.c
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h
libxfs/xfs_alloc_btree.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_btree.c
libxfs/xfs_da_btree.c
libxfs/xfs_dir2.c
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_data.c
libxfs/xfs_dir2_leaf.c
libxfs/xfs_dir2_node.c
libxfs/xfs_dir2_priv.h
libxfs/xfs_dir2_sf.c
libxfs/xfs_dquot_buf.c
libxfs/xfs_ialloc.c
libxfs/xfs_ialloc_btree.c
libxfs/xfs_inode_buf.c
libxfs/xfs_log_format.h
libxfs/xfs_refcount.c
libxfs/xfs_sb.c
libxfs/xfs_trans_inode.c
libxfs/xfs_trans_resv.c
libxfs/xfs_trans_space.h

index 4fc5460596bf465d5a15d7a6658314bea0bf113f..6691ca70f66506ce071afc20254cb44a90c5382a 100644 (file)
@@ -607,9 +607,9 @@ xfs_agiblock_init(
        }
        for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++)
                agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO);
-       if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) {
+       if (xfs_has_inobtcounts(mp)) {
                agi->agi_iblocks = cpu_to_be32(1);
-               if (xfs_sb_version_hasfinobt(&mp->m_sb))
+               if (xfs_has_finobt(mp))
                        agi->agi_fblocks = cpu_to_be32(1);
        }
 }
index c615974303650ddfdec6d736a9d74af3a64f0000..c60aeb637e578fb5641a94fc02a52c682c1e097a 100644 (file)
@@ -2260,7 +2260,7 @@ xfs_alloc_min_freelist(
        min_free += min_t(unsigned int, levels[XFS_BTNUM_CNTi] + 1,
                                       mp->m_ag_maxlevels);
        /* space needed reverse mapping used space btree */
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (xfs_has_rmapbt(mp))
                min_free += min_t(unsigned int, levels[XFS_BTNUM_RMAPi] + 1,
                                                mp->m_rmap_maxlevels);
 
@@ -2908,7 +2908,7 @@ xfs_agf_verify(
             be32_to_cpu(agf->agf_levels[XFS_BTNUM_RMAP]) > mp->m_rmap_maxlevels))
                return __this_address;
 
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb) &&
+       if (xfs_has_rmapbt(mp) &&
            be32_to_cpu(agf->agf_rmap_blocks) > be32_to_cpu(agf->agf_length))
                return __this_address;
 
@@ -2921,16 +2921,16 @@ xfs_agf_verify(
        if (bp->b_pag && be32_to_cpu(agf->agf_seqno) != bp->b_pag->pag_agno)
                return __this_address;
 
-       if (xfs_sb_version_haslazysbcount(&mp->m_sb) &&
+       if (xfs_has_lazysbcount(mp) &&
            be32_to_cpu(agf->agf_btreeblks) > be32_to_cpu(agf->agf_length))
                return __this_address;
 
-       if (xfs_sb_version_hasreflink(&mp->m_sb) &&
+       if (xfs_has_reflink(mp) &&
            be32_to_cpu(agf->agf_refcount_blocks) >
            be32_to_cpu(agf->agf_length))
                return __this_address;
 
-       if (xfs_sb_version_hasreflink(&mp->m_sb) &&
+       if (xfs_has_reflink(mp) &&
            (be32_to_cpu(agf->agf_refcount_level) < 1 ||
             be32_to_cpu(agf->agf_refcount_level) > mp->m_refc_maxlevels))
                return __this_address;
@@ -3069,7 +3069,7 @@ xfs_alloc_read_agf(
                 * counter only tracks non-root blocks.
                 */
                allocbt_blks = pag->pagf_btreeblks;
-               if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+               if (xfs_has_rmapbt(mp))
                        allocbt_blks -= be32_to_cpu(agf->agf_rmap_blocks) - 1;
                if (allocbt_blks > 0)
                        atomic64_add(allocbt_blks, &mp->m_allocbt_blks);
index e14c56938bacc278e2800c108b112b7cca728c23..df4aefaf0046e818b49a87b1fdc35b2a00398de9 100644 (file)
@@ -243,7 +243,7 @@ static inline __be32 *
 xfs_buf_to_agfl_bno(
        struct xfs_buf          *bp)
 {
-       if (xfs_sb_version_hascrc(&bp->b_mount->m_sb))
+       if (xfs_has_crc(bp->b_mount))
                return bp->b_addr + sizeof(struct xfs_agfl);
        return bp->b_addr;
 }
index a8a24fa45cc94da91b1e8063b4a14e3c7641e3fa..94f2d7b6800bd0ccbe13dcf3c8d599ae04bfdd2b 100644 (file)
@@ -293,7 +293,7 @@ xfs_allocbt_verify(
        if (!xfs_verify_magic(bp, block->bb_magic))
                return __this_address;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                fa = xfs_btree_sblock_v5hdr_verify(bp);
                if (fa)
                        return fa;
index f5f228bc52d0cc30e8884724e36ce9eaa0d6c92f..237af83e85a92c7e2fc6eeafb4b670b869f093ab 100644 (file)
@@ -426,7 +426,7 @@ xfs_bmbt_verify(
        if (!xfs_verify_magic(bp, block->bb_magic))
                return __this_address;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                /*
                 * XXX: need a better way of verifying the owner here. Right now
                 * just make sure there has been one set.
index cfa36d5d837399c2ee373a7594253ff794bc6a1f..8b2459e3e1208397508f764ae3993c6e1f208d7d 100644 (file)
@@ -270,7 +270,7 @@ xfs_btree_lblock_calc_crc(
        struct xfs_btree_block  *block = XFS_BUF_TO_BLOCK(bp);
        struct xfs_buf_log_item *bip = bp->b_log_item;
 
-       if (!xfs_sb_version_hascrc(&bp->b_mount->m_sb))
+       if (!xfs_has_crc(bp->b_mount))
                return;
        if (bip)
                block->bb_u.l.bb_lsn = cpu_to_be64(bip->bli_item.li_lsn);
@@ -308,7 +308,7 @@ xfs_btree_sblock_calc_crc(
        struct xfs_btree_block  *block = XFS_BUF_TO_BLOCK(bp);
        struct xfs_buf_log_item *bip = bp->b_log_item;
 
-       if (!xfs_sb_version_hascrc(&bp->b_mount->m_sb))
+       if (!xfs_has_crc(bp->b_mount))
                return;
        if (bip)
                block->bb_u.s.bb_lsn = cpu_to_be64(bip->bli_item.li_lsn);
@@ -1746,7 +1746,7 @@ xfs_btree_lookup_get_block(
                return error;
 
        /* Check the inode owner since the verifiers don't. */
-       if (xfs_sb_version_hascrc(&cur->bc_mp->m_sb) &&
+       if (xfs_has_crc(cur->bc_mp) &&
            !(cur->bc_ino.flags & XFS_BTCUR_BMBT_INVALID_OWNER) &&
            (cur->bc_flags & XFS_BTREE_LONG_PTRS) &&
            be64_to_cpu((*blkp)->bb_u.l.bb_owner) !=
index 196f0a9e2b21201932ab233d6355ee593b2b1383..d2dec4aabc2b5b9853457f04a03c9be701adfba4 100644 (file)
@@ -126,7 +126,7 @@ xfs_da3_node_hdr_from_disk(
        struct xfs_da3_icnode_hdr       *to,
        struct xfs_da_intnode           *from)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_da3_intnode  *from3 = (struct xfs_da3_intnode *)from;
 
                to->forw = be32_to_cpu(from3->hdr.info.hdr.forw);
@@ -153,7 +153,7 @@ xfs_da3_node_hdr_to_disk(
        struct xfs_da_intnode           *to,
        struct xfs_da3_icnode_hdr       *from)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_da3_intnode  *to3 = (struct xfs_da3_intnode *)to;
 
                ASSERT(from->magic == XFS_DA3_NODE_MAGIC);
@@ -188,7 +188,7 @@ xfs_da3_blkinfo_verify(
        if (!xfs_verify_magic16(bp, hdr->magic))
                return __this_address;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
                        return __this_address;
                if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
index dff874398b93fc30e5c10c5b44eab0dd159271e0..f072130492b736d44bda7124774cee7000a0eaf1 100644 (file)
@@ -114,7 +114,7 @@ xfs_da_mount(
        dageo->fsblog = mp->m_sb.sb_blocklog;
        dageo->blksize = xfs_dir2_dirblock_bytes(&mp->m_sb);
        dageo->fsbcount = 1 << mp->m_sb.sb_dirblklog;
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                dageo->node_hdr_size = sizeof(struct xfs_da3_node_hdr);
                dageo->leaf_hdr_size = sizeof(struct xfs_dir3_leaf_hdr);
                dageo->free_hdr_size = sizeof(struct xfs_dir3_free_hdr);
@@ -729,7 +729,7 @@ xfs_dir2_hashname(
        struct xfs_mount        *mp,
        struct xfs_name         *name)
 {
-       if (unlikely(xfs_sb_version_hasasciici(&mp->m_sb)))
+       if (unlikely(xfs_has_asciici(mp)))
                return xfs_ascii_ci_hashname(name);
        return xfs_da_hashname(name->name, name->len);
 }
@@ -740,7 +740,7 @@ xfs_dir2_compname(
        const unsigned char     *name,
        int                     len)
 {
-       if (unlikely(xfs_sb_version_hasasciici(&args->dp->i_mount->m_sb)))
+       if (unlikely(xfs_has_asciici(args->dp->i_mount)))
                return xfs_ascii_ci_compname(args, name, len);
        return xfs_da_compname(args, name, len);
 }
index 4373e819c07ab1ba962279a4136504d19b143182..f5d0f703b1b573e248e0290a0e12149fbbbf0c44 100644 (file)
@@ -50,7 +50,7 @@ xfs_dir3_block_verify(
        if (!xfs_verify_magic(bp, hdr3->magic))
                return __this_address;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
                        return __this_address;
                if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
@@ -118,7 +118,7 @@ xfs_dir3_block_header_check(
 {
        struct xfs_mount        *mp = dp->i_mount;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr;
 
                if (be64_to_cpu(hdr3->owner) != dp->i_ino)
index 76f55736578760e454e5509b5b30d98c4b67ce85..85cb14d3ff21c4cbe5b87afb27da56f43f8e68f0 100644 (file)
@@ -26,7 +26,7 @@ xfs_dir2_data_bestfree_p(
        struct xfs_mount                *mp,
        struct xfs_dir2_data_hdr        *hdr)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb))
+       if (xfs_has_crc(mp))
                return ((struct xfs_dir3_data_hdr *)hdr)->best_free;
        return hdr->bestfree;
 }
@@ -48,7 +48,7 @@ xfs_dir2_data_get_ftype(
        struct xfs_mount                *mp,
        struct xfs_dir2_data_entry      *dep)
 {
-       if (xfs_sb_version_hasftype(&mp->m_sb)) {
+       if (xfs_has_ftype(mp)) {
                uint8_t                 ftype = dep->name[dep->namelen];
 
                if (likely(ftype < XFS_DIR3_FT_MAX))
@@ -67,7 +67,7 @@ xfs_dir2_data_put_ftype(
        ASSERT(ftype < XFS_DIR3_FT_MAX);
        ASSERT(dep->namelen != 0);
 
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                dep->name[dep->namelen] = ftype;
 }
 
@@ -294,7 +294,7 @@ xfs_dir3_data_verify(
        if (!xfs_verify_magic(bp, hdr3->magic))
                return __this_address;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                if (!uuid_equal(&hdr3->uuid, &mp->m_sb.sb_meta_uuid))
                        return __this_address;
                if (be64_to_cpu(hdr3->blkno) != bp->b_bn)
@@ -398,7 +398,7 @@ xfs_dir3_data_header_check(
 {
        struct xfs_mount        *mp = dp->i_mount;
 
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_dir3_data_hdr *hdr3 = bp->b_addr;
 
                if (be64_to_cpu(hdr3->hdr.owner) != dp->i_ino)
index cd63b37eae64aba43122a1759c7a1cde21c5bc77..70b1f08321da885d3fc44ffa16fd92103f53973c 100644 (file)
@@ -35,7 +35,7 @@ xfs_dir2_leaf_hdr_from_disk(
        struct xfs_dir3_icleaf_hdr      *to,
        struct xfs_dir2_leaf            *from)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_dir3_leaf *from3 = (struct xfs_dir3_leaf *)from;
 
                to->forw = be32_to_cpu(from3->hdr.info.hdr.forw);
@@ -66,7 +66,7 @@ xfs_dir2_leaf_hdr_to_disk(
        struct xfs_dir2_leaf            *to,
        struct xfs_dir3_icleaf_hdr      *from)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_dir3_leaf *to3 = (struct xfs_dir3_leaf *)to;
 
                ASSERT(from->magic == XFS_DIR3_LEAF1_MAGIC ||
index 2bccabaf010a2a3276d687884e1390dfab466801..e7ed4b46fa178b56ced84255ab9f95eb155d7813 100644 (file)
@@ -244,7 +244,7 @@ xfs_dir2_free_hdr_from_disk(
        struct xfs_dir3_icfree_hdr      *to,
        struct xfs_dir2_free            *from)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_dir3_free    *from3 = (struct xfs_dir3_free *)from;
 
                to->magic = be32_to_cpu(from3->hdr.hdr.magic);
@@ -271,7 +271,7 @@ xfs_dir2_free_hdr_to_disk(
        struct xfs_dir2_free            *to,
        struct xfs_dir3_icfree_hdr      *from)
 {
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                struct xfs_dir3_free    *to3 = (struct xfs_dir3_free *)to;
 
                ASSERT(from->magic == XFS_DIR3_FREE_MAGIC);
index 94943ce49cab0198c42ab26c68f2e771fa125b27..711709a2aa53cdf6a73e37023bfe0860370e7f30 100644 (file)
@@ -196,7 +196,7 @@ xfs_dir2_data_entsize(
 
        len = offsetof(struct xfs_dir2_data_entry, name[0]) + namelen +
                        sizeof(xfs_dir2_data_off_t) /* tag */;
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                len += sizeof(uint8_t);
        return round_up(len, XFS_DIR2_DATA_ALIGN);
 }
index 6a57ad27edc6a9d604eab44028b9e8005e187c12..751b634780cfc0fb7e028f49a56e4d604ae0fbb7 100644 (file)
@@ -48,7 +48,7 @@ xfs_dir2_sf_entsize(
        count += sizeof(struct xfs_dir2_sf_entry);      /* namelen + offset */
        count += hdr->i8count ? XFS_INO64_SIZE : XFS_INO32_SIZE; /* ino # */
 
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                count += sizeof(uint8_t);
        return count;
 }
@@ -76,7 +76,7 @@ xfs_dir2_sf_get_ino(
 {
        uint8_t                         *from = sfep->name + sfep->namelen;
 
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                from++;
 
        if (!hdr->i8count)
@@ -95,7 +95,7 @@ xfs_dir2_sf_put_ino(
 
        ASSERT(ino <= XFS_MAXINUMBER);
 
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                to++;
 
        if (hdr->i8count)
@@ -135,7 +135,7 @@ xfs_dir2_sf_get_ftype(
        struct xfs_mount                *mp,
        struct xfs_dir2_sf_entry        *sfep)
 {
-       if (xfs_sb_version_hasftype(&mp->m_sb)) {
+       if (xfs_has_ftype(mp)) {
                uint8_t                 ftype = sfep->name[sfep->namelen];
 
                if (ftype < XFS_DIR3_FT_MAX)
@@ -153,7 +153,7 @@ xfs_dir2_sf_put_ftype(
 {
        ASSERT(ftype < XFS_DIR3_FT_MAX);
 
-       if (xfs_sb_version_hasftype(&mp->m_sb))
+       if (xfs_has_ftype(mp))
                sfep->name[sfep->namelen] = ftype;
 }
 
index b77f303c2b579a747cd266a9982846b881467c46..ecb4a0027dcb86eaf77ab298078026bd746a593a 100644 (file)
@@ -68,7 +68,7 @@ xfs_dquot_verify(
                return __this_address;
 
        if ((ddq->d_type & XFS_DQTYPE_BIGTIME) &&
-           !xfs_sb_version_hasbigtime(&mp->m_sb))
+           !xfs_has_bigtime(mp))
                return __this_address;
 
        if ((ddq->d_type & XFS_DQTYPE_BIGTIME) && !ddq->d_id)
index 7ba6b5e9f07291c726e6052aecfffd1f5a45a8a0..cbccc072ca594e2d30961517c6d6b50af38e3c7f 100644 (file)
@@ -297,7 +297,7 @@ xfs_ialloc_inode_init(
         * That means for v3 inode we log the entire buffer rather than just the
         * inode cores.
         */
-       if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
+       if (xfs_has_v3inodes(mp)) {
                version = 3;
                ino = XFS_AGINO_TO_INO(mp, agno, XFS_AGB_TO_AGINO(mp, agbno));
 
@@ -630,7 +630,7 @@ xfs_ialloc_ag_alloc(
 
 #ifdef DEBUG
        /* randomly do sparse inode allocations */
-       if (xfs_sb_version_hassparseinodes(&tp->t_mountp->m_sb) &&
+       if (xfs_has_sparseinodes(tp->t_mountp) &&
            igeo->ialloc_min_blks < igeo->ialloc_blks)
                do_sparse = prandom_u32() & 1;
 #endif
@@ -749,7 +749,7 @@ xfs_ialloc_ag_alloc(
         * Finally, try a sparse allocation if the filesystem supports it and
         * the sparse allocation length is smaller than a full chunk.
         */
-       if (xfs_sb_version_hassparseinodes(&args.mp->m_sb) &&
+       if (xfs_has_sparseinodes(args.mp) &&
            igeo->ialloc_min_blks < igeo->ialloc_blks &&
            args.fsbno == NULLFSBLOCK) {
 sparse_alloc:
@@ -851,7 +851,7 @@ sparse_alloc:
                 * from the previous call. Set merge false to replace any
                 * existing record with this one.
                 */
-               if (xfs_sb_version_hasfinobt(&args.mp->m_sb)) {
+               if (xfs_has_finobt(args.mp)) {
                        error = xfs_inobt_insert_sprec(args.mp, tp, agbp, pag,
                                       XFS_BTNUM_FINO, &rec, false);
                        if (error)
@@ -864,7 +864,7 @@ sparse_alloc:
                if (error)
                        return error;
 
-               if (xfs_sb_version_hasfinobt(&args.mp->m_sb)) {
+               if (xfs_has_finobt(args.mp)) {
                        error = xfs_inobt_insert(args.mp, tp, agbp, pag, newino,
                                                 newlen, XFS_BTNUM_FINO);
                        if (error)
@@ -1443,7 +1443,7 @@ xfs_dialloc_ag(
        int                             offset;
        int                             i;
 
-       if (!xfs_sb_version_hasfinobt(&mp->m_sb))
+       if (!xfs_has_finobt(mp))
                return xfs_dialloc_ag_inobt(tp, agbp, pag, parent, inop);
 
        /*
@@ -2182,7 +2182,7 @@ xfs_difree(
        /*
         * Fix up the free inode btree.
         */
-       if (xfs_sb_version_hasfinobt(&mp->m_sb)) {
+       if (xfs_has_finobt(mp)) {
                error = xfs_difree_finobt(mp, tp, agbp, pag, agino, &rec);
                if (error)
                        goto error0;
@@ -2766,7 +2766,7 @@ xfs_ialloc_setup_geometry(
        uint                    inodes;
 
        igeo->new_diflags2 = 0;
-       if (xfs_sb_version_hasbigtime(&mp->m_sb))
+       if (xfs_has_bigtime(mp))
                igeo->new_diflags2 |= XFS_DIFLAG2_BIGTIME;
 
        /* Compute inode btree geometry. */
@@ -2821,7 +2821,7 @@ xfs_ialloc_setup_geometry(
         * cannot change the behavior.
         */
        igeo->inode_cluster_size_raw = XFS_INODE_BIG_CLUSTER_SIZE;
-       if (xfs_sb_version_has_v3inode(&mp->m_sb)) {
+       if (xfs_has_v3inodes(mp)) {
                int     new_size = igeo->inode_cluster_size_raw;
 
                new_size *= mp->m_sb.sb_inodesize / XFS_DINODE_MIN_SIZE;
@@ -2839,7 +2839,7 @@ xfs_ialloc_setup_geometry(
        igeo->inodes_per_cluster = XFS_FSB_TO_INO(mp, igeo->blocks_per_cluster);
 
        /* Calculate inode cluster alignment. */
-       if (xfs_sb_version_hasalign(&mp->m_sb) &&
+       if (xfs_has_align(mp) &&
            mp->m_sb.sb_inoalignmt >= igeo->blocks_per_cluster)
                igeo->cluster_align = mp->m_sb.sb_inoalignmt;
        else
@@ -2887,15 +2887,15 @@ xfs_ialloc_calc_rootino(
        first_bno += xfs_alloc_min_freelist(mp, NULL);
 
        /* ...the free inode btree root... */
-       if (xfs_sb_version_hasfinobt(&mp->m_sb))
+       if (xfs_has_finobt(mp))
                first_bno++;
 
        /* ...the reverse mapping btree root... */
-       if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+       if (xfs_has_rmapbt(mp))
                first_bno++;
 
        /* ...the reference count btree... */
-       if (xfs_sb_version_hasreflink(&mp->m_sb))
+       if (xfs_has_reflink(mp))
                first_bno++;
 
        /*
@@ -2913,9 +2913,9 @@ xfs_ialloc_calc_rootino(
         * Now round first_bno up to whatever allocation alignment is given
         * by the filesystem or was passed in.
         */
-       if (xfs_sb_version_hasdalign(&mp->m_sb) && igeo->ialloc_align > 0)
+       if (xfs_has_dalign(mp) && igeo->ialloc_align > 0)
                first_bno = roundup(first_bno, sunit);
-       else if (xfs_sb_version_hasalign(&mp->m_sb) &&
+       else if (xfs_has_align(mp) &&
                        mp->m_sb.sb_inoalignmt > 1)
                first_bno = roundup(first_bno, mp->m_sb.sb_inoalignmt);
 
index 5fb9620323505ff36dd1563fd44a4792383da377..14b5918bf0322a3e668bdc97e7ed0fa362dc743b 100644 (file)
@@ -75,7 +75,7 @@ xfs_inobt_mod_blockcount(
        struct xfs_buf          *agbp = cur->bc_ag.agbp;
        struct xfs_agi          *agi = agbp->b_addr;
 
-       if (!xfs_sb_version_hasinobtcounts(&cur->bc_mp->m_sb))
+       if (!xfs_has_inobtcounts(cur->bc_mp))
                return;
 
        if (cur->bc_btnum == XFS_BTNUM_FINO)
@@ -291,7 +291,7 @@ xfs_inobt_verify(
         * but beware of the landmine (i.e. need to check pag->pagi_init) if we
         * ever do.
         */
-       if (xfs_sb_version_hascrc(&mp->m_sb)) {
+       if (xfs_has_crc(mp)) {
                fa = xfs_btree_sblock_v5hdr_verify(bp);
                if (fa)
                        return fa;
@@ -510,7 +510,7 @@ xfs_inobt_commit_staged_btree(
                fields = XFS_AGI_ROOT | XFS_AGI_LEVEL;
                agi->agi_root = cpu_to_be32(afake->af_root);
                agi->agi_level = cpu_to_be32(afake->af_levels);
-               if (xfs_sb_version_hasinobtcounts(&cur->bc_mp->m_sb)) {
+               if (xfs_has_inobtcounts(cur->bc_mp)) {
                        agi->agi_iblocks = cpu_to_be32(afake->af_blocks);
                        fields |= XFS_AGI_IBLOCKS;
                }
@@ -520,7 +520,7 @@ xfs_inobt_commit_staged_btree(
                fields = XFS_AGI_FREE_ROOT | XFS_AGI_FREE_LEVEL;
                agi->agi_free_root = cpu_to_be32(afake->af_root);
                agi->agi_free_level = cpu_to_be32(afake->af_levels);
-               if (xfs_sb_version_hasinobtcounts(&cur->bc_mp->m_sb)) {
+               if (xfs_has_inobtcounts(cur->bc_mp)) {
                        agi->agi_fblocks = cpu_to_be32(afake->af_blocks);
                        fields |= XFS_AGI_IBLOCKS;
                }
@@ -739,7 +739,7 @@ xfs_finobt_calc_reserves(
        if (!xfs_has_finobt(mp))
                return 0;
 
-       if (xfs_sb_version_hasinobtcounts(&mp->m_sb))
+       if (xfs_has_inobtcounts(mp))
                error = xfs_finobt_read_blocks(mp, tp, pag, &tree_len);
        else
                error = xfs_inobt_count_blocks(mp, tp, pag, XFS_BTNUM_FINO,
index 946261cde208dba35f3a5cc794662e5423230511..2638e515b52c72e85e5423083339bdc0845bb9eb 100644 (file)
@@ -189,7 +189,7 @@ xfs_inode_from_disk(
         * inode. If the inode is unused, mode is zero and we shouldn't mess
         * with the uninitialized part of it.
         */
-       if (!xfs_sb_version_has_v3inode(&ip->i_mount->m_sb))
+       if (!xfs_has_v3inodes(ip->i_mount))
                ip->i_flushiter = be16_to_cpu(from->di_flushiter);
        inode->i_generation = be32_to_cpu(from->di_gen);
        inode->i_mode = be16_to_cpu(from->di_mode);
@@ -232,7 +232,7 @@ xfs_inode_from_disk(
        if (from->di_dmevmask || from->di_dmstate)
                xfs_iflags_set(ip, XFS_IPRESERVE_DM_FIELDS);
 
-       if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
+       if (xfs_has_v3inodes(ip->i_mount)) {
                inode_set_iversion_queried(inode,
                                           be64_to_cpu(from->di_changecount));
                ip->i_crtime = xfs_inode_from_disk_ts(from, from->di_crtime);
@@ -310,7 +310,7 @@ xfs_inode_to_disk(
        to->di_aformat = xfs_ifork_format(ip->i_afp);
        to->di_flags = cpu_to_be16(ip->i_diflags);
 
-       if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
+       if (xfs_has_v3inodes(ip->i_mount)) {
                to->di_version = 3;
                to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
                to->di_crtime = xfs_inode_to_disk_ts(ip, ip->i_crtime);
@@ -410,7 +410,7 @@ xfs_dinode_verify(
 
        /* Verify v3 integrity information first */
        if (dip->di_version >= 3) {
-               if (!xfs_sb_version_has_v3inode(&mp->m_sb))
+               if (!xfs_has_v3inodes(mp))
                        return __this_address;
                if (!xfs_verify_cksum((char *)dip, mp->m_sb.sb_inodesize,
                                      XFS_DINODE_CRC_OFF))
@@ -531,7 +531,7 @@ xfs_dinode_verify(
 
        /* bigtime iflag can only happen on bigtime filesystems */
        if (xfs_dinode_has_bigtime(dip) &&
-           !xfs_sb_version_hasbigtime(&mp->m_sb))
+           !xfs_has_bigtime(mp))
                return __this_address;
 
        return NULL;
index 28c020472f9a05595c5283da259d99e052073ec6..b322db523d65c849fc7bee35f0df1f9c37e81126 100644 (file)
@@ -434,7 +434,7 @@ struct xfs_log_dinode {
 };
 
 #define xfs_log_dinode_size(mp)                                                \
-       (xfs_sb_version_has_v3inode(&(mp)->m_sb) ?                      \
+       (xfs_has_v3inodes((mp)) ?                                       \
                sizeof(struct xfs_log_dinode) :                         \
                offsetof(struct xfs_log_dinode, di_next_unlinked))
 
index 1c9e7722fe65cba4a06f0d59713399a4e99910fe..2aa64d3e23f27fbdd887292366cff4f79751308e 100644 (file)
@@ -1252,7 +1252,7 @@ xfs_refcount_increase_extent(
        struct xfs_trans                *tp,
        struct xfs_bmbt_irec            *PREV)
 {
-       if (!xfs_sb_version_hasreflink(&tp->t_mountp->m_sb))
+       if (!xfs_has_reflink(tp->t_mountp))
                return;
 
        __xfs_refcount_add(tp, XFS_REFCOUNT_INCREASE, PREV->br_startblock,
@@ -1267,7 +1267,7 @@ xfs_refcount_decrease_extent(
        struct xfs_trans                *tp,
        struct xfs_bmbt_irec            *PREV)
 {
-       if (!xfs_sb_version_hasreflink(&tp->t_mountp->m_sb))
+       if (!xfs_has_reflink(tp->t_mountp))
                return;
 
        __xfs_refcount_add(tp, XFS_REFCOUNT_DECREASE, PREV->br_startblock,
@@ -1616,7 +1616,7 @@ xfs_refcount_alloc_cow_extent(
 {
        struct xfs_mount                *mp = tp->t_mountp;
 
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return;
 
        __xfs_refcount_add(tp, XFS_REFCOUNT_ALLOC_COW, fsb, len);
@@ -1635,7 +1635,7 @@ xfs_refcount_free_cow_extent(
 {
        struct xfs_mount                *mp = tp->t_mountp;
 
-       if (!xfs_sb_version_hasreflink(&mp->m_sb))
+       if (!xfs_has_reflink(mp))
                return;
 
        /* Remove rmap entry */
index a2ad15169f9e19818fd1496e065a40e025db5744..18be916428fe0905cdf493ff095431c3c1b9797d 100644 (file)
@@ -909,7 +909,7 @@ xfs_log_sb(
         * unclean shutdown, this will be corrected by log recovery rebuilding
         * the counters from the AGF block counts.
         */
-       if (xfs_sb_version_haslazysbcount(&mp->m_sb)) {
+       if (xfs_has_lazysbcount(mp)) {
                mp->m_sb.sb_icount = percpu_counter_sum(&mp->m_icount);
                mp->m_sb.sb_ifree = percpu_counter_sum(&mp->m_ifree);
                mp->m_sb.sb_fdblocks = percpu_counter_sum(&mp->m_fdblocks);
index 06d11a5cf8f74b8109cb7fbe6224a08a10386b08..276d57cf737bb0a2010a3c4bb740791590c2bdce 100644 (file)
@@ -133,7 +133,7 @@ xfs_trans_log_inode(
         * to upgrade this inode to bigtime format, do so now.
         */
        if ((flags & (XFS_ILOG_CORE | XFS_ILOG_TIMESTAMP)) &&
-           xfs_sb_version_hasbigtime(&ip->i_mount->m_sb) &&
+           xfs_has_bigtime(ip->i_mount) &&
            !xfs_inode_has_bigtime(ip)) {
                ip->i_diflags2 |= XFS_DIFLAG2_BIGTIME;
                flags |= XFS_ILOG_CORE;
index ea57e8108def80661edde09a0d8545f5362d7f8f..d383528df0457cc48a22c8f789a8b207abd3c9f6 100644 (file)
@@ -186,7 +186,7 @@ xfs_calc_inode_chunk_res(
                               XFS_FSB_TO_B(mp, 1));
        if (alloc) {
                /* icreate tx uses ordered buffers */
-               if (xfs_sb_version_has_v3inode(&mp->m_sb))
+               if (xfs_has_v3inodes(mp))
                        return res;
                size = XFS_FSB_TO_B(mp, 1);
        }
@@ -267,7 +267,7 @@ xfs_calc_write_reservation(
             xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
             xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
 
-       if (xfs_sb_version_hasrealtime(&mp->m_sb)) {
+       if (xfs_has_realtime(mp)) {
                t2 = xfs_calc_inode_res(mp, 1) +
                     xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
                                     blksz) +
@@ -316,7 +316,7 @@ xfs_calc_itruncate_reservation(
        t2 = xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
             xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4), blksz);
 
-       if (xfs_sb_version_hasrealtime(&mp->m_sb)) {
+       if (xfs_has_realtime(mp)) {
                t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
                     xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 2), blksz) +
                     xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
index 7ad3659c5d2a9fc6edd38affbb6ab03c17fcbbac..50332be343881e88c8211087741450ae480efd9b 100644 (file)
@@ -57,8 +57,7 @@
        XFS_DAREMOVE_SPACE_RES(mp, XFS_DATA_FORK)
 #define        XFS_IALLOC_SPACE_RES(mp)        \
        (M_IGEO(mp)->ialloc_blks + \
-        ((xfs_sb_version_hasfinobt(&mp->m_sb) ? 2 : 1) * \
-         M_IGEO(mp)->inobt_maxlevels))
+        ((xfs_has_finobt(mp) ? 2 : 1) * M_IGEO(mp)->inobt_maxlevels))
 
 /*
  * Space reservation values for various transactions.
@@ -94,8 +93,7 @@
 #define        XFS_SYMLINK_SPACE_RES(mp,nl,b)  \
        (XFS_IALLOC_SPACE_RES(mp) + XFS_DIRENTER_SPACE_RES(mp,nl) + (b))
 #define XFS_IFREE_SPACE_RES(mp)                \
-       (xfs_sb_version_hasfinobt(&mp->m_sb) ? \
-                       M_IGEO(mp)->inobt_maxlevels : 0)
+       (xfs_has_finobt(mp) ? M_IGEO(mp)->inobt_maxlevels : 0)
 
 
 #endif /* __XFS_TRANS_SPACE_H__ */