@@ -411,7 +411,7 @@ xfs_check_rmap(
*/
if (map->fmr_flags & (FMR_OF_PREALLOC | FMR_OF_ATTR_FORK |
FMR_OF_EXTENT_MAP | FMR_OF_SPECIAL_OWNER))
- goto out;
+ return true;
/* XXX: Filter out directory data blocks. */
@@ -423,16 +423,6 @@ xfs_check_rmap(
return false;
}
-out:
- /* Is this the last extent? Fire off the read. */
- if (map->fmr_flags & FMR_OF_LAST) {
- ret = read_verify_force_io(rvp);
- if (ret) {
- str_liberror(ctx, ret, descr);
- return false;
- }
- }
-
return true;
}
@@ -448,6 +438,10 @@ clean_pool(
if (!rvp)
return 0;
+ ret = read_verify_force_io(rvp);
+ if (ret)
+ return ret;
+
ret = read_verify_pool_flush(rvp);
if (ret)
goto out_destroy;
@@ -282,22 +282,30 @@ read_verify_schedule_io(
return 0;
}
+/* Force any per-thread stashed IOs into the verifier. */
+static int
+force_one_io(
+ struct ptvar *ptv,
+ void *data,
+ void *foreach_arg)
+{
+ struct read_verify_pool *rvp = foreach_arg;
+ struct read_verify *rv = data;
+
+ if (rv->io_length == 0)
+ return 0;
+
+ return read_verify_queue(rvp, rv);
+}
+
/* Force any stashed IOs into the verifier. */
int
read_verify_force_io(
struct read_verify_pool *rvp)
{
- struct read_verify *rv;
- int ret;
-
assert(rvp->readbuf);
- rv = ptvar_get(rvp->rvstate, &ret);
- if (ret)
- return ret;
- if (rv->io_length == 0)
- return 0;
- return read_verify_queue(rvp, rv);
+ return ptvar_foreach(rvp->rvstate, force_one_io, rvp);
}
/* How many bytes has this process verified? */