xfs: add a new xfs_iext_lookup_extent_before helper
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Oct 2017 23:32:39 +0000 (16:32 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Oct 2017 22:38:28 +0000 (15:38 -0700)
commitdc56015faff1bc9e7493c2b28302c423a02237c2
treeb929e2deb6b55e0aa0df4bb1ccda6d1eb808a3aa
parent211e95bbab71359e56f3d9adce1b4d6de8e18471
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>
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_inode_fork.c
fs/xfs/libxfs/xfs_inode_fork.h
fs/xfs/xfs_reflink.c