From: Darrick J. Wong <djwong@xxxxxxxxxx> Once we've assembled all the parent pointers for a file, we need to commit the new dataset atomically to that file. Parent pointer records are embedded in the xattr structure, which means that we must write a new extended attribute structure, again, atomically. Therefore, we must copy the non-parent-pointer attributes from the file being repaired into the temporary file's extended attributes and then call the atomic extent swap mechanism to exchange the blocks. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- libxfs/xfs_attr.c | 2 +- libxfs/xfs_attr.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c index cb4c2726fd7..5da0ac9f706 100644 --- a/libxfs/xfs_attr.c +++ b/libxfs/xfs_attr.c @@ -933,7 +933,7 @@ xfs_attr_defer_add( trace_xfs_attr_defer_add(new->xattri_dela_state, args->dp); } -STATIC int +int xfs_attr_add_fork( struct xfs_inode *ip, /* incore inode pointer */ int size, /* space new attribute needs */ diff --git a/libxfs/xfs_attr.h b/libxfs/xfs_attr.h index 0204f62298c..a2cfe9e35fd 100644 --- a/libxfs/xfs_attr.h +++ b/libxfs/xfs_attr.h @@ -650,4 +650,6 @@ xfs_attri_can_use_without_log_assistance( return false; } +int xfs_attr_add_fork(struct xfs_inode *ip, int size, int rsvd); + #endif /* __XFS_ATTR_H__ */