aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_btree.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2017-01-28 02:16:37 -0500
committerDarrick J. Wong <darrick.wong@oracle.com>2017-01-30 19:32:24 -0500
commitf88ae46b09e93ef07ac9efaf85df62adb5ba58e6 (patch)
tree3760a0ed2c9020e6417c36636c49d1082586e945 /fs/xfs/libxfs/xfs_btree.c
parent566cf877a1fcb6d6dc0126b076aad062054c2637 (diff)
xfs: glean crc status from mp not flags in xfs_btree_init_block_int
xfs_btree_init_block_int() can determine whether crcs are in effect without the passed-in XFS_BTREE_CRC_BLOCKS flag; the mp argument allows us to determine this from the superblock. Remove the flag from callers, and use xfs_sb_version_hascrc(&mp->m_sb) internally instead. This removes one difference between the if & else cases in the callers. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_btree.c')
-rw-r--r--fs/xfs/libxfs/xfs_btree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 21e6a6ab6b9a..c91823c202b6 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -1090,6 +1090,8 @@ xfs_btree_init_block_int(
1090 __u64 owner, 1090 __u64 owner,
1091 unsigned int flags) 1091 unsigned int flags)
1092{ 1092{
1093 int crc = xfs_sb_version_hascrc(&mp->m_sb);
1094
1093 buf->bb_magic = cpu_to_be32(magic); 1095 buf->bb_magic = cpu_to_be32(magic);
1094 buf->bb_level = cpu_to_be16(level); 1096 buf->bb_level = cpu_to_be16(level);
1095 buf->bb_numrecs = cpu_to_be16(numrecs); 1097 buf->bb_numrecs = cpu_to_be16(numrecs);
@@ -1097,7 +1099,7 @@ xfs_btree_init_block_int(
1097 if (flags & XFS_BTREE_LONG_PTRS) { 1099 if (flags & XFS_BTREE_LONG_PTRS) {
1098 buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK); 1100 buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK);
1099 buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK); 1101 buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK);
1100 if (flags & XFS_BTREE_CRC_BLOCKS) { 1102 if (crc) {
1101 buf->bb_u.l.bb_blkno = cpu_to_be64(blkno); 1103 buf->bb_u.l.bb_blkno = cpu_to_be64(blkno);
1102 buf->bb_u.l.bb_owner = cpu_to_be64(owner); 1104 buf->bb_u.l.bb_owner = cpu_to_be64(owner);
1103 uuid_copy(&buf->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid); 1105 uuid_copy(&buf->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid);
@@ -1110,7 +1112,7 @@ xfs_btree_init_block_int(
1110 1112
1111 buf->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK); 1113 buf->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK);
1112 buf->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK); 1114 buf->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK);
1113 if (flags & XFS_BTREE_CRC_BLOCKS) { 1115 if (crc) {
1114 buf->bb_u.s.bb_blkno = cpu_to_be64(blkno); 1116 buf->bb_u.s.bb_blkno = cpu_to_be64(blkno);
1115 buf->bb_u.s.bb_owner = cpu_to_be32(__owner); 1117 buf->bb_u.s.bb_owner = cpu_to_be32(__owner);
1116 uuid_copy(&buf->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid); 1118 uuid_copy(&buf->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid);