summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_inode_buf.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-02-16 11:47:28 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-02-18 09:38:41 -0800
commit15baadf72cedc2a09ea792c1fc59451502b55da2 (patch)
tree065992ac6a62f3dd3bb46b58734f999db5748b51 /fs/xfs/libxfs/xfs_inode_buf.c
parent7588cbeec6df925ef6142a7e48762896c06007a8 (diff)
downloadlwn-15baadf72cedc2a09ea792c1fc59451502b55da2.tar.gz
lwn-15baadf72cedc2a09ea792c1fc59451502b55da2.zip
xfs: fix xfs_buf magic number endian checks
Create a separate magic16 check function so that we don't run afoul of static checkers. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index f92f14e93ad3..e021d5133ccb 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -97,7 +97,7 @@ xfs_inode_buf_verify(
dip = xfs_buf_offset(bp, (i << mp->m_sb.sb_inodelog));
unlinked_ino = be32_to_cpu(dip->di_next_unlinked);
- di_ok = xfs_verify_magic(bp, dip->di_magic) &&
+ di_ok = xfs_verify_magic16(bp, dip->di_magic) &&
xfs_dinode_good_version(mp, dip->di_version) &&
xfs_verify_agino_or_null(mp, agno, unlinked_ino);
if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
@@ -146,16 +146,16 @@ xfs_inode_buf_write_verify(
const struct xfs_buf_ops xfs_inode_buf_ops = {
.name = "xfs_inode",
- .magic = { cpu_to_be16(XFS_DINODE_MAGIC),
- cpu_to_be16(XFS_DINODE_MAGIC) },
+ .magic16 = { cpu_to_be16(XFS_DINODE_MAGIC),
+ cpu_to_be16(XFS_DINODE_MAGIC) },
.verify_read = xfs_inode_buf_read_verify,
.verify_write = xfs_inode_buf_write_verify,
};
const struct xfs_buf_ops xfs_inode_buf_ra_ops = {
.name = "xfs_inode_ra",
- .magic = { cpu_to_be16(XFS_DINODE_MAGIC),
- cpu_to_be16(XFS_DINODE_MAGIC) },
+ .magic16 = { cpu_to_be16(XFS_DINODE_MAGIC),
+ cpu_to_be16(XFS_DINODE_MAGIC) },
.verify_read = xfs_inode_buf_readahead_verify,
.verify_write = xfs_inode_buf_write_verify,
};