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 <dchinner@redhat.com> Reviewed-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Darrick J. Wong <djwong@kernel.org> Signed-off-by:
Darrick J. Wong <djwong@kernel.org>
Showing
- fs/xfs/libxfs/xfs_ag.c 10 additions, 10 deletionsfs/xfs/libxfs/xfs_ag.c
- fs/xfs/libxfs/xfs_alloc.c 17 additions, 17 deletionsfs/xfs/libxfs/xfs_alloc.c
- fs/xfs/libxfs/xfs_alloc_btree.c 1 addition, 1 deletionfs/xfs/libxfs/xfs_alloc_btree.c
- fs/xfs/libxfs/xfs_alloc_btree.h 1 addition, 1 deletionfs/xfs/libxfs/xfs_alloc_btree.h
- fs/xfs/libxfs/xfs_attr_leaf.c 7 additions, 7 deletionsfs/xfs/libxfs/xfs_attr_leaf.c
- fs/xfs/libxfs/xfs_attr_remote.c 5 additions, 5 deletionsfs/xfs/libxfs/xfs_attr_remote.c
- fs/xfs/libxfs/xfs_bmap.c 6 additions, 6 deletionsfs/xfs/libxfs/xfs_bmap.c
- fs/xfs/libxfs/xfs_bmap_btree.c 2 additions, 2 deletionsfs/xfs/libxfs/xfs_bmap_btree.c
- fs/xfs/libxfs/xfs_bmap_btree.h 1 addition, 1 deletionfs/xfs/libxfs/xfs_bmap_btree.h
- fs/xfs/libxfs/xfs_btree.c 7 additions, 7 deletionsfs/xfs/libxfs/xfs_btree.c
- fs/xfs/libxfs/xfs_da_btree.c 2 additions, 2 deletionsfs/xfs/libxfs/xfs_da_btree.c
- fs/xfs/libxfs/xfs_da_format.h 1 addition, 1 deletionfs/xfs/libxfs/xfs_da_format.h
- fs/xfs/libxfs/xfs_dir2_block.c 3 additions, 3 deletionsfs/xfs/libxfs/xfs_dir2_block.c
- fs/xfs/libxfs/xfs_dir2_data.c 3 additions, 3 deletionsfs/xfs/libxfs/xfs_dir2_data.c
- fs/xfs/libxfs/xfs_dir2_leaf.c 3 additions, 3 deletionsfs/xfs/libxfs/xfs_dir2_leaf.c
- fs/xfs/libxfs/xfs_dir2_node.c 5 additions, 5 deletionsfs/xfs/libxfs/xfs_dir2_node.c
- fs/xfs/libxfs/xfs_dir2_sf.c 1 addition, 1 deletionfs/xfs/libxfs/xfs_dir2_sf.c
- fs/xfs/libxfs/xfs_dquot_buf.c 3 additions, 3 deletionsfs/xfs/libxfs/xfs_dquot_buf.c
- fs/xfs/libxfs/xfs_format.h 5 additions, 5 deletionsfs/xfs/libxfs/xfs_format.h
- fs/xfs/libxfs/xfs_ialloc.c 7 additions, 7 deletionsfs/xfs/libxfs/xfs_ialloc.c
Please register or sign in to comment