diff options
| author | Dave Chinner <[email protected]> | 2021-08-19 01:46:37 +0000 |
|---|---|---|
| committer | Darrick J. Wong <[email protected]> | 2021-08-19 17:07:12 +0000 |
| commit | 38c26bfd90e1999650d5ef40f90d721f05916643 (patch) | |
| tree | d65af121fdc940c0ae8ebbf8c05cc8b5c559ceda /fs/xfs/libxfs/xfs_alloc_btree.h | |
| parent | xfs: reflect sb features in xfs_mount (diff) | |
| download | kernel-38c26bfd90e1999650d5ef40f90d721f05916643.tar.gz kernel-38c26bfd90e1999650d5ef40f90d721f05916643.zip | |
xfs: replace xfs_sb_version checks with feature flag checks
Convert the xfs_sb_version_hasfoo() to checks against
mp->m_features. Checks of the superblock itself during disk
operations (e.g. in the read/write verifiers and the to/from disk
formatters) are not converted - they operate purely on the
superblock state. Everything else should use the mount features.
Large parts of this conversion were done with sed with commands like
this:
for f in `git grep -l xfs_sb_version_has fs/xfs/*.c`; do
sed -i -e 's/xfs_sb_version_has\(.*\)(&\(.*\)->m_sb)/xfs_has_\1(\2)/' $f
done
With manual cleanups for things like "xfs_has_extflgbit" and other
little inconsistencies in naming.
The result is ia lot less typing to check features and an XFS binary
size reduced by a bit over 3kB:
$ size -t fs/xfs/built-in.a
text data bss dec hex filenam
before 1130866 311352 484 1442702 16038e (TOTALS)
after 1127727 311352 484 1439563 15f74b (TOTALS)
Signed-off-by: Dave Chinner <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc_btree.h')
| -rw-r--r-- | fs/xfs/libxfs/xfs_alloc_btree.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc_btree.h b/fs/xfs/libxfs/xfs_alloc_btree.h index 9eb4c667a6b8..2f6b816aaf9f 100644 --- a/fs/xfs/libxfs/xfs_alloc_btree.h +++ b/fs/xfs/libxfs/xfs_alloc_btree.h @@ -20,7 +20,7 @@ struct xbtree_afakeroot; * Btree block header size depends on a superblock flag. */ #define XFS_ALLOC_BLOCK_LEN(mp) \ - (xfs_sb_version_hascrc(&((mp)->m_sb)) ? \ + (xfs_has_crc(((mp))) ? \ XFS_BTREE_SBLOCK_CRC_LEN : XFS_BTREE_SBLOCK_LEN) /* |
