aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_inode_fork.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-10-23 16:32:39 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-10-26 15:38:28 -0700
commitdc56015faff1bc9e7493c2b28302c423a02237c2 (patch)
treeb929e2deb6b55e0aa0df4bb1ccda6d1eb808a3aa /fs/xfs/libxfs/xfs_inode_fork.h
parentxfs: merge xfs_bmap_read_extents into xfs_iread_extents (diff)
downloadlinux-dev-dc56015faff1bc9e7493c2b28302c423a02237c2.tar.xz
linux-dev-dc56015faff1bc9e7493c2b28302c423a02237c2.zip
xfs: add a new xfs_iext_lookup_extent_before helper
This helper looks up the last extent the covers space before the passed in block number. This is useful for truncate and similar operations that operate backwards over the extent list. For xfs_bunmapi it also is a slight optimization as we can return early if there are not extents at or below the end of the to be truncated range. 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.h')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
index e0c42ea9b8d0..113fd42ec36d 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.h
+++ b/fs/xfs/libxfs/xfs_inode_fork.h
@@ -183,6 +183,10 @@ void xfs_iext_irec_update_extoffs(struct xfs_ifork *, int, int);
bool xfs_iext_lookup_extent(struct xfs_inode *ip,
struct xfs_ifork *ifp, xfs_fileoff_t bno,
xfs_extnum_t *idxp, struct xfs_bmbt_irec *gotp);
+bool xfs_iext_lookup_extent_before(struct xfs_inode *ip,
+ struct xfs_ifork *ifp, xfs_fileoff_t *end,
+ xfs_extnum_t *idxp, struct xfs_bmbt_irec *gotp);
+
bool xfs_iext_get_extent(struct xfs_ifork *ifp, xfs_extnum_t idx,
struct xfs_bmbt_irec *gotp);
void xfs_iext_update_extent(struct xfs_inode *ip, int state,