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>
This commit is contained in:

committed by
Darrick J. Wong

parent
09f420197d
commit
39708c20ab
@@ -310,7 +310,7 @@ xfs_rmapbt_verify(
|
||||
* from the on disk AGF. Again, we can only check against maximum limits
|
||||
* in this case.
|
||||
*/
|
||||
if (block->bb_magic != cpu_to_be32(XFS_RMAP_CRC_MAGIC))
|
||||
if (!xfs_verify_magic(bp, block->bb_magic))
|
||||
return __this_address;
|
||||
|
||||
if (!xfs_sb_version_hasrmapbt(&mp->m_sb))
|
||||
@@ -365,6 +365,7 @@ xfs_rmapbt_write_verify(
|
||||
|
||||
const struct xfs_buf_ops xfs_rmapbt_buf_ops = {
|
||||
.name = "xfs_rmapbt",
|
||||
.magic = { 0, cpu_to_be32(XFS_RMAP_CRC_MAGIC) },
|
||||
.verify_read = xfs_rmapbt_read_verify,
|
||||
.verify_write = xfs_rmapbt_write_verify,
|
||||
.verify_struct = xfs_rmapbt_verify,
|
||||
|
Reference in New Issue
Block a user