aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_ialloc.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_ialloc.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_ialloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index d32152fc8a6c..fe9898875097 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -2508,7 +2508,7 @@ xfs_agi_verify(
2508 /* 2508 /*
2509 * Validate the magic number of the agi block. 2509 * Validate the magic number of the agi block.
2510 */ 2510 */
2511 if (agi->agi_magicnum != cpu_to_be32(XFS_AGI_MAGIC)) 2511 if (!xfs_verify_magic(bp, agi->agi_magicnum))
2512 return __this_address; 2512 return __this_address;
2513 if (!XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum))) 2513 if (!XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)))
2514 return __this_address; 2514 return __this_address;
@@ -2582,6 +2582,7 @@ xfs_agi_write_verify(
2582 2582
2583const struct xfs_buf_ops xfs_agi_buf_ops = { 2583const struct xfs_buf_ops xfs_agi_buf_ops = {
2584 .name = "xfs_agi", 2584 .name = "xfs_agi",
2585 .magic = { cpu_to_be32(XFS_AGI_MAGIC), cpu_to_be32(XFS_AGI_MAGIC) },
2585 .verify_read = xfs_agi_read_verify, 2586 .verify_read = xfs_agi_read_verify,
2586 .verify_write = xfs_agi_write_verify, 2587 .verify_write = xfs_agi_write_verify,
2587 .verify_struct = xfs_agi_verify, 2588 .verify_struct = xfs_agi_verify,