aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_refcount_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_refcount_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_refcount_btree.c')
-rw-r--r--fs/xfs/libxfs/xfs_refcount_btree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c
index d9eab657b63e..6f47ab876d90 100644
--- a/fs/xfs/libxfs/xfs_refcount_btree.c
+++ b/fs/xfs/libxfs/xfs_refcount_btree.c
@@ -209,7 +209,7 @@ xfs_refcountbt_verify(
209 xfs_failaddr_t fa; 209 xfs_failaddr_t fa;
210 unsigned int level; 210 unsigned int level;
211 211
212 if (block->bb_magic != cpu_to_be32(XFS_REFC_CRC_MAGIC)) 212 if (!xfs_verify_magic(bp, block->bb_magic))
213 return __this_address; 213 return __this_address;
214 214
215 if (!xfs_sb_version_hasreflink(&mp->m_sb)) 215 if (!xfs_sb_version_hasreflink(&mp->m_sb))
@@ -264,6 +264,7 @@ xfs_refcountbt_write_verify(
264 264
265const struct xfs_buf_ops xfs_refcountbt_buf_ops = { 265const struct xfs_buf_ops xfs_refcountbt_buf_ops = {
266 .name = "xfs_refcountbt", 266 .name = "xfs_refcountbt",
267 .magic = { 0, cpu_to_be32(XFS_REFC_CRC_MAGIC) },
267 .verify_read = xfs_refcountbt_read_verify, 268 .verify_read = xfs_refcountbt_read_verify,
268 .verify_write = xfs_refcountbt_write_verify, 269 .verify_write = xfs_refcountbt_write_verify,
269 .verify_struct = xfs_refcountbt_verify, 270 .verify_struct = xfs_refcountbt_verify,