diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-14 16:34:31 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-16 03:57:05 +0300 |
commit | 8389f3ffa22a119b37dc7c2217cd2862bb2ed9da (patch) | |
tree | cb736467d60f15c66f599ec5478a8dce52c1d421 /fs/xfs/scrub/common.h | |
parent | c9fbd7bbc23dbdd73364be4d045e5d3612cf6e82 (diff) | |
download | linux-8389f3ffa22a119b37dc7c2217cd2862bb2ed9da.tar.xz |
xfs: skip scrub xref if corruption already noted
Don't bother looking for cross-referencing problems if the metadata is
already corrupt or we've already found a cross-referencing problem.
Since we added a helper function for flags testing, convert existing
users to use it.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/common.h')
-rw-r--r-- | fs/xfs/scrub/common.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h index c95c30c986b7..a23ad7fa2b6c 100644 --- a/fs/xfs/scrub/common.h +++ b/fs/xfs/scrub/common.h @@ -145,4 +145,14 @@ int xfs_scrub_setup_inode_contents(struct xfs_scrub_context *sc, struct xfs_inode *ip, unsigned int resblks); void xfs_scrub_buffer_recheck(struct xfs_scrub_context *sc, struct xfs_buf *bp); +/* + * Don't bother cross-referencing if we already found corruption or cross + * referencing discrepancies. + */ +static inline bool xfs_scrub_skip_xref(struct xfs_scrub_metadata *sm) +{ + return sm->sm_flags & (XFS_SCRUB_OFLAG_CORRUPT | + XFS_SCRUB_OFLAG_XCORRUPT); +} + #endif /* __XFS_SCRUB_COMMON_H__ */ |