xfs: factor xfs_da3_blkinfo verification into common helper
authorBrian Foster <bfoster@redhat.com>
Thu, 7 Feb 2019 18:45:48 +0000 (10:45 -0800)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 12 Feb 2019 00:07:01 +0000 (16:07 -0800)
commit8764f98351fa561296f70c3435a5cb1eb6272c39
treea4f94adf68453c5b24d14a98377448ed490a64cc
parent39708c20ab51337c3eb282a824eb0aaff7ebe2e1
xfs: factor xfs_da3_blkinfo verification into common helper

With the verifier magic value helper in place, we've left a bit more
duplicate code across the verifiers that involve struct
xfs_da3_blkinfo. This includes the da node, xattr leaf and dir leaf
verifiers, all of which perform similar checks for v4 and v5
filesystems.

Create a common helper to verify an xfs_da3_blkinfo structure,
taking care to only access v5 fields where appropriate, and refactor
the aforementioned verifiers to use the helper. 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>
fs/xfs/libxfs/xfs_attr_leaf.c
fs/xfs/libxfs/xfs_da_btree.c
fs/xfs/libxfs/xfs_da_format.h
fs/xfs/libxfs/xfs_dir2_leaf.c