aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_rmap_btree.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2019-02-07 13:45:48 -0500
committerDarrick J. Wong <darrick.wong@oracle.com>2019-02-11 19:07:01 -0500
commit39708c20ab51337c3eb282a824eb0aaff7ebe2e1 (patch)
treead3e741a8fbafdfa13531f9efdf91557daada42d /fs/xfs/libxfs/xfs_rmap_btree.c
parent09f420197d7ced360b4809606efd7a65f842c2c0 (diff)
xfs: miscellaneous verifier magic value fixups
Most buffer verifiers have hardcoded magic value checks conditionalized on the version of the filesystem. The magic value field of the verifier structure facilitates abstraction of some of this code. Populate the ->magic field of various verifiers to take advantage of this abstraction. No functional changes. Signed-off-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_rmap_btree.c')
-rw-r--r--fs/xfs/libxfs/xfs_rmap_btree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c
index f79cf040d745..5738e11055e6 100644
--- a/fs/xfs/libxfs/xfs_rmap_btree.c
+++ b/fs/xfs/libxfs/xfs_rmap_btree.c
@@ -310,7 +310,7 @@ xfs_rmapbt_verify(
310 * from the on disk AGF. Again, we can only check against maximum limits 310 * from the on disk AGF. Again, we can only check against maximum limits
311 * in this case. 311 * in this case.
312 */ 312 */
313 if (block->bb_magic != cpu_to_be32(XFS_RMAP_CRC_MAGIC)) 313 if (!xfs_verify_magic(bp, block->bb_magic))
314 return __this_address; 314 return __this_address;
315 315
316 if (!xfs_sb_version_hasrmapbt(&mp->m_sb)) 316 if (!xfs_sb_version_hasrmapbt(&mp->m_sb))
@@ -365,6 +365,7 @@ xfs_rmapbt_write_verify(
365 365
366const struct xfs_buf_ops xfs_rmapbt_buf_ops = { 366const struct xfs_buf_ops xfs_rmapbt_buf_ops = {
367 .name = "xfs_rmapbt", 367 .name = "xfs_rmapbt",
368 .magic = { 0, cpu_to_be32(XFS_RMAP_CRC_MAGIC) },
368 .verify_read = xfs_rmapbt_read_verify, 369 .verify_read = xfs_rmapbt_read_verify,
369 .verify_write = xfs_rmapbt_write_verify, 370 .verify_write = xfs_rmapbt_write_verify,
370 .verify_struct = xfs_rmapbt_verify, 371 .verify_struct = xfs_rmapbt_verify,