Commit 2755fc44 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Dave Chinner

xfs: use new extent lookup helpers in __xfs_reflink_reserve_cow

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 656152e5
...@@ -243,10 +243,11 @@ xfs_reflink_reserve_cow( ...@@ -243,10 +243,11 @@ xfs_reflink_reserve_cow(
struct xfs_bmbt_irec *imap, struct xfs_bmbt_irec *imap,
bool *shared) bool *shared)
{ {
struct xfs_bmbt_irec got, prev; struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, XFS_COW_FORK);
struct xfs_bmbt_irec got;
xfs_fileoff_t end_fsb, orig_end_fsb; xfs_fileoff_t end_fsb, orig_end_fsb;
int eof = 0, error = 0; int error = 0;
bool trimmed; bool eof = false, trimmed;
xfs_extnum_t idx; xfs_extnum_t idx;
xfs_extlen_t align; xfs_extlen_t align;
...@@ -258,8 +259,9 @@ xfs_reflink_reserve_cow( ...@@ -258,8 +259,9 @@ xfs_reflink_reserve_cow(
* extent list is generally faster than going out to the shared extent * extent list is generally faster than going out to the shared extent
* tree. * tree.
*/ */
xfs_bmap_search_extents(ip, imap->br_startoff, XFS_COW_FORK, &eof, &idx,
&got, &prev); if (!xfs_iext_lookup_extent(ip, ifp, imap->br_startoff, &idx, &got))
eof = true;
if (!eof && got.br_startoff <= imap->br_startoff) { if (!eof && got.br_startoff <= imap->br_startoff) {
trace_xfs_reflink_cow_found(ip, imap); trace_xfs_reflink_cow_found(ip, imap);
xfs_trim_extent(imap, got.br_startoff, got.br_blockcount); xfs_trim_extent(imap, got.br_startoff, got.br_blockcount);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment