diff options
author | Darrick J. Wong | 2017-10-17 21:37:35 -0700 |
---|---|---|
committer | Darrick J. Wong | 2017-10-26 15:38:23 -0700 |
commit | a56371865e7870d953d3837aaa1d12230bba021d (patch) | |
tree | ebf64ec2c0a6c710c7fe1c40356d0f990820b226 /fs/xfs/scrub/scrub.h | |
parent | 36fd6e863cb7329ab2e5687fdae4e4626b840adc (diff) |
xfs: dispatch metadata scrub subcommands
Create structures needed to hold scrubbing context and dispatch incoming
commands to the individual scrubbers.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/scrub.h')
-rw-r--r-- | fs/xfs/scrub/scrub.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h index eb1cd9dde868..ef7b50e33c93 100644 --- a/fs/xfs/scrub/scrub.h +++ b/fs/xfs/scrub/scrub.h @@ -20,6 +20,30 @@ #ifndef __XFS_SCRUB_SCRUB_H__ #define __XFS_SCRUB_SCRUB_H__ +struct xfs_scrub_context; + +struct xfs_scrub_meta_ops { + /* Acquire whatever resources are needed for the operation. */ + int (*setup)(struct xfs_scrub_context *, + struct xfs_inode *); + + /* Examine metadata for errors. */ + int (*scrub)(struct xfs_scrub_context *); + + /* Decide if we even have this piece of metadata. */ + bool (*has)(struct xfs_sb *); +}; + +struct xfs_scrub_context { + /* General scrub state. */ + struct xfs_mount *mp; + struct xfs_scrub_metadata *sm; + const struct xfs_scrub_meta_ops *ops; + struct xfs_trans *tp; + struct xfs_inode *ip; + bool try_harder; +}; + /* Metadata scrubbers */ #endif /* __XFS_SCRUB_SCRUB_H__ */ |