summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_swapext.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-28 12:55:21 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-10-14 14:16:54 -0700
commit5bd49aac43773b89bbe633cddfb4ecd45ce5ca41 (patch)
tree324f9fd0eac73799e1ad5f461a4bbd5f012339e9 /fs/xfs/libxfs/xfs_swapext.c
parent9f3799ef28dd12ad01c8ce3217b082c1f76d245c (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/libxfs/xfs_swapext.c')
-rw-r--r--fs/xfs/libxfs/xfs_swapext.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_swapext.c b/fs/xfs/libxfs/xfs_swapext.c
index 940913af502a..ce677abe3ad4 100644
--- a/fs/xfs/libxfs/xfs_swapext.c
+++ b/fs/xfs/libxfs/xfs_swapext.c
@@ -709,7 +709,7 @@ xfs_swapext_rmapbt_blocks(
}
/* Estimate the bmbt and rmapbt overhead required to exchange extents. */
-static int
+int
xfs_swapext_estimate_overhead(
struct xfs_swapext_req *req)
{