summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_bmap.c
diff options
context:
space:
mode:
authorChristoph Hellwig2016-11-24 01:39:43 +0100
committerDave Chinner2016-11-24 01:39:43 +0100
commit334f3423d6a6c39483aa0744ea044e105ca0e5ae (patch)
treeff3faf8c70dabd5322209a0fb884280aa61c7e84 /fs/xfs/libxfs/xfs_bmap.c
parentxfs: cleanup xfs_bmap_last_before (diff)
downloadkernel-qcow2-linux-334f3423d6a6c39483aa0744ea044e105ca0e5ae.tar.gz
kernel-qcow2-linux-334f3423d6a6c39483aa0744ea044e105ca0e5ae.tar.xz
kernel-qcow2-linux-334f3423d6a6c39483aa0744ea044e105ca0e5ae.zip
xfs: use new extent lookup helpers in xfs_bmapi_read
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 13f62da67bbc..aac5cc3cd9ef 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -4145,12 +4145,11 @@ xfs_bmapi_read(
struct xfs_mount *mp = ip->i_mount;
struct xfs_ifork *ifp;
struct xfs_bmbt_irec got;
- struct xfs_bmbt_irec prev;
xfs_fileoff_t obno;
xfs_fileoff_t end;
- xfs_extnum_t lastx;
+ xfs_extnum_t idx;
int error;
- int eof;
+ bool eof = false;
int n = 0;
int whichfork = xfs_bmapi_whichfork(flags);
@@ -4190,7 +4189,8 @@ xfs_bmapi_read(
return error;
}
- xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, &prev);
+ if (!xfs_iext_lookup_extent(ip, ifp, bno, &idx, &got))
+ eof = true;
end = bno + len;
obno = bno;
@@ -4221,10 +4221,8 @@ xfs_bmapi_read(
break;
/* Else go on to the next record. */
- if (++lastx < xfs_iext_count(ifp))
- xfs_bmbt_get_all(xfs_iext_get_ext(ifp, lastx), &got);
- else
- eof = 1;
+ if (!xfs_iext_get_extent(ifp, ++idx, &got))
+ eof = true;
}
*nmap = n;
return 0;