summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_inode_fork.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-08-30 01:44:11 +0300
committerDarrick J. Wong <darrick.wong@oracle.com>2017-09-01 20:55:30 +0300
commit67e4e69cb2a7afbffdefd1a0a23a94d1d706c38f (patch)
tree51db8bbd69d9af10e792896e72be40ebd510f5f6 /fs/xfs/libxfs/xfs_inode_fork.c
parentd522d569d6adf72ceda90153a086e089e6c2fbc6 (diff)
downloadlinux-67e4e69cb2a7afbffdefd1a0a23a94d1d706c38f.tar.xz
xfs: add a xfs_iext_update_extent helper
This helper is used to update an extent record based on the extent index, and can be used to provide a level of abstractions between callers that want to modify in-core extent records and the details of the extent list implementation. Also switch all users of the xfs_bmbt_set_all(xfs_iext_get_ext(...)) pattern to this new helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_fork.c')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c
index 0e80f34fe97c..fb310d08dc82 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.c
+++ b/fs/xfs/libxfs/xfs_inode_fork.c
@@ -2023,3 +2023,15 @@ xfs_iext_get_extent(
xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx), gotp);
return true;
}
+
+void
+xfs_iext_update_extent(
+ struct xfs_ifork *ifp,
+ xfs_extnum_t idx,
+ struct xfs_bmbt_irec *gotp)
+{
+ ASSERT(idx >= 0);
+ ASSERT(idx < xfs_iext_count(ifp));
+
+ xfs_bmbt_set_all(xfs_iext_get_ext(ifp, idx), gotp);
+}