Commit 2b9e9b57 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: xfs_scrub_bmap should use for_each_xfs_iext

Refactor xfs_scrub_bmap to use for_each_xfs_iext now that it exists.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent e5b37faa
...@@ -235,7 +235,6 @@ xfs_scrub_bmap( ...@@ -235,7 +235,6 @@ xfs_scrub_bmap(
struct xfs_ifork *ifp; struct xfs_ifork *ifp;
xfs_fileoff_t endoff; xfs_fileoff_t endoff;
struct xfs_iext_cursor icur; struct xfs_iext_cursor icur;
bool found;
int error = 0; int error = 0;
ifp = XFS_IFORK_PTR(ip, whichfork); ifp = XFS_IFORK_PTR(ip, whichfork);
...@@ -314,9 +313,7 @@ xfs_scrub_bmap( ...@@ -314,9 +313,7 @@ xfs_scrub_bmap(
/* Scrub extent records. */ /* Scrub extent records. */
info.lastoff = 0; info.lastoff = 0;
ifp = XFS_IFORK_PTR(ip, whichfork); ifp = XFS_IFORK_PTR(ip, whichfork);
for (found = xfs_iext_lookup_extent(ip, ifp, 0, &icur, &irec); for_each_xfs_iext(ifp, &icur, &irec) {
found != 0;
found = xfs_iext_next_extent(ifp, &icur, &irec)) {
if (xfs_scrub_should_terminate(sc, &error)) if (xfs_scrub_should_terminate(sc, &error))
break; break;
if (isnullstartblock(irec.br_startblock)) if (isnullstartblock(irec.br_startblock))
......
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