summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/attr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-08 14:52:07 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2019-11-10 16:54:19 -0800
commit649d9d98c60ec5e76e2a3c010f21667746765e9c (patch)
treec091fd268a09ab96f46971b1a84cf7f17abb1b24 /fs/xfs/scrub/attr.c
parentb16be561876ed9b72dcb2bf8c48b30f573f63c1c (diff)
xfs: refactor btree node scrubbing
Break up xchk_da_btree_entry and handle looking up leaf node entries in the attr / dir callbacks, so that only the generic node handling is left in the common core code. Note that the checks for the crc enabled blocks are removed, as the scrubbing code already remaps the magic numbers earlier. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/scrub/attr.c')
-rw-r--r--fs/xfs/scrub/attr.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index 0edc7f8eb96e..d9f0dd444b80 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -398,15 +398,14 @@ out:
STATIC int
xchk_xattr_rec(
struct xchk_da_btree *ds,
- int level,
- void *rec)
+ int level)
{
struct xfs_mount *mp = ds->state->mp;
- struct xfs_attr_leaf_entry *ent = rec;
- struct xfs_da_state_blk *blk;
+ struct xfs_da_state_blk *blk = &ds->state->path.blk[level];
struct xfs_attr_leaf_name_local *lentry;
struct xfs_attr_leaf_name_remote *rentry;
struct xfs_buf *bp;
+ struct xfs_attr_leaf_entry *ent;
xfs_dahash_t calc_hash;
xfs_dahash_t hash;
int nameidx;
@@ -414,7 +413,9 @@ xchk_xattr_rec(
unsigned int badflags;
int error;
- blk = &ds->state->path.blk[level];
+ ASSERT(blk->magic == XFS_ATTR_LEAF_MAGIC);
+
+ ent = xfs_attr3_leaf_entryp(blk->bp->b_addr) + blk->index;
/* Check the whole block, if necessary. */
error = xchk_xattr_block(ds, level);