diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2017-01-27 23:16:37 -0800 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-01-30 16:32:24 -0800 |
commit | f88ae46b09e93ef07ac9efaf85df62adb5ba58e6 (patch) | |
tree | 3760a0ed2c9020e6417c36636c49d1082586e945 /fs/xfs | |
parent | 566cf877a1fcb6d6dc0126b076aad062054c2637 (diff) | |
download | linux-stable-f88ae46b09e93ef07ac9efaf85df62adb5ba58e6.tar.gz linux-stable-f88ae46b09e93ef07ac9efaf85df62adb5ba58e6.tar.bz2 linux-stable-f88ae46b09e93ef07ac9efaf85df62adb5ba58e6.zip |
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')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 4 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap_btree.c | 2 | ||||
-rw-r--r-- | fs/xfs/libxfs/xfs_btree.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_fsops.c | 14 |
4 files changed, 13 insertions, 13 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index bfc00de5c6f1..1d4b8d5edaaf 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -743,7 +743,7 @@ xfs_bmap_extents_to_btree( if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block_int(mp, block, XFS_BUF_DADDR_NULL, XFS_BMAP_CRC_MAGIC, 1, 1, ip->i_ino, - XFS_BTREE_LONG_PTRS | XFS_BTREE_CRC_BLOCKS); + XFS_BTREE_LONG_PTRS); else xfs_btree_init_block_int(mp, block, XFS_BUF_DADDR_NULL, XFS_BMAP_MAGIC, 1, 1, ip->i_ino, @@ -820,7 +820,7 @@ try_another_ag: if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block_int(mp, ablock, abp->b_bn, XFS_BMAP_CRC_MAGIC, 0, 0, ip->i_ino, - XFS_BTREE_LONG_PTRS | XFS_BTREE_CRC_BLOCKS); + XFS_BTREE_LONG_PTRS); else xfs_btree_init_block_int(mp, ablock, abp->b_bn, XFS_BMAP_MAGIC, 0, 0, ip->i_ino, diff --git a/fs/xfs/libxfs/xfs_bmap_btree.c b/fs/xfs/libxfs/xfs_bmap_btree.c index d9be241fc86f..a80bf8080b1c 100644 --- a/fs/xfs/libxfs/xfs_bmap_btree.c +++ b/fs/xfs/libxfs/xfs_bmap_btree.c @@ -74,7 +74,7 @@ xfs_bmdr_to_bmbt( if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block_int(mp, rblock, XFS_BUF_DADDR_NULL, XFS_BMAP_CRC_MAGIC, 0, 0, ip->i_ino, - XFS_BTREE_LONG_PTRS | XFS_BTREE_CRC_BLOCKS); + XFS_BTREE_LONG_PTRS); else xfs_btree_init_block_int(mp, rblock, XFS_BUF_DADDR_NULL, XFS_BMAP_MAGIC, 0, 0, ip->i_ino, 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( __u64 owner, unsigned int flags) { + int crc = xfs_sb_version_hascrc(&mp->m_sb); + buf->bb_magic = cpu_to_be32(magic); buf->bb_level = cpu_to_be16(level); buf->bb_numrecs = cpu_to_be16(numrecs); @@ -1097,7 +1099,7 @@ xfs_btree_init_block_int( if (flags & XFS_BTREE_LONG_PTRS) { buf->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK); buf->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK); - if (flags & XFS_BTREE_CRC_BLOCKS) { + if (crc) { buf->bb_u.l.bb_blkno = cpu_to_be64(blkno); buf->bb_u.l.bb_owner = cpu_to_be64(owner); uuid_copy(&buf->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid); @@ -1110,7 +1112,7 @@ xfs_btree_init_block_int( buf->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK); buf->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK); - if (flags & XFS_BTREE_CRC_BLOCKS) { + if (crc) { buf->bb_u.s.bb_blkno = cpu_to_be64(blkno); buf->bb_u.s.bb_owner = cpu_to_be32(__owner); uuid_copy(&buf->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid); diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 242e8091296d..21e3cdbaebbc 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -354,7 +354,7 @@ xfs_growfs_data_private( if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block(mp, bp, XFS_ABTB_CRC_MAGIC, 0, 1, - agno, XFS_BTREE_CRC_BLOCKS); + agno, 0); else xfs_btree_init_block(mp, bp, XFS_ABTB_MAGIC, 0, 1, agno, 0); @@ -383,7 +383,7 @@ xfs_growfs_data_private( if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block(mp, bp, XFS_ABTC_CRC_MAGIC, 0, 1, - agno, XFS_BTREE_CRC_BLOCKS); + agno, 0); else xfs_btree_init_block(mp, bp, XFS_ABTC_MAGIC, 0, 1, agno, 0); @@ -414,7 +414,7 @@ xfs_growfs_data_private( } xfs_btree_init_block(mp, bp, XFS_RMAP_CRC_MAGIC, 0, 0, - agno, XFS_BTREE_CRC_BLOCKS); + agno, 0); block = XFS_BUF_TO_BLOCK(bp); @@ -490,7 +490,7 @@ xfs_growfs_data_private( if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block(mp, bp, XFS_IBT_CRC_MAGIC, 0, 0, - agno, XFS_BTREE_CRC_BLOCKS); + agno, 0); else xfs_btree_init_block(mp, bp, XFS_IBT_MAGIC, 0, 0, agno, 0); @@ -515,8 +515,7 @@ xfs_growfs_data_private( if (xfs_sb_version_hascrc(&mp->m_sb)) xfs_btree_init_block(mp, bp, XFS_FIBT_CRC_MAGIC, - 0, 0, agno, - XFS_BTREE_CRC_BLOCKS); + 0, 0, agno, 0); else xfs_btree_init_block(mp, bp, XFS_FIBT_MAGIC, 0, 0, agno, 0); @@ -541,8 +540,7 @@ xfs_growfs_data_private( } xfs_btree_init_block(mp, bp, XFS_REFC_CRC_MAGIC, - 0, 0, agno, - XFS_BTREE_CRC_BLOCKS); + 0, 0, agno, 0); error = xfs_bwrite(bp); xfs_buf_relse(bp); |