diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-07-28 12:55:21 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-10-14 14:16:54 -0700 |
commit | 5bd49aac43773b89bbe633cddfb4ecd45ce5ca41 (patch) | |
tree | 324f9fd0eac73799e1ad5f461a4bbd5f012339e9 /fs/xfs/scrub/tempswap.h | |
parent | 9f3799ef28dd12ad01c8ce3217b082c1f76d245c (diff) |
xfs: use atomic extent swapping to fix user file fork data
Build on the code that was recently added to the temporary repair file
code so that we can atomically switch the contents of any file fork,
even if the fork is in local format. The upcoming functions to repair
xattrs, directories, and symlinks will need that capability.
Repair can lock out access to these user files by holding IOLOCK_EXCL on
these user files. Therefore, it is safe to drop the ILOCK of both the
file being repaired and the tempfile being used for staging, and cancel
the scrub transaction. We do this so that we can reuse the resource
estimation and transaction allocation functions used by a regular file
exchange operation.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/tempswap.h')
-rw-r--r-- | fs/xfs/scrub/tempswap.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/scrub/tempswap.h b/fs/xfs/scrub/tempswap.h index 62e88cc6d91a..bef8d2d2134d 100644 --- a/fs/xfs/scrub/tempswap.h +++ b/fs/xfs/scrub/tempswap.h @@ -14,6 +14,8 @@ struct xrep_tempswap { int xrep_tempswap_grab_log_assist(struct xfs_scrub *sc); int xrep_tempswap_trans_reserve(struct xfs_scrub *sc, int whichfork, struct xrep_tempswap *ti); +int xrep_tempswap_trans_alloc(struct xfs_scrub *sc, int whichfork, + struct xrep_tempswap *ti); int xrep_tempswap_contents(struct xfs_scrub *sc, struct xrep_tempswap *ti); #endif /* CONFIG_XFS_ONLINE_REPAIR */ |