]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - scrub/read_verify.c
libfrog: convert ptvar.c functions to negative error codes
[thirdparty/xfsprogs-dev.git] / scrub / read_verify.c
index 82605c8c10a49f32ec97a9fb0b2fd50cd0ae7f78..bfee3a6613ad1566e02a274fec9ad80788942ae1 100644 (file)
@@ -119,7 +119,7 @@ read_verify_pool_alloc(
        rvp->ctx = ctx;
        rvp->disk = disk;
        rvp->ioerr_fn = ioerr_fn;
-       ret = ptvar_alloc(submitter_threads, sizeof(struct read_verify),
+       ret = -ptvar_alloc(submitter_threads, sizeof(struct read_verify),
                        &rvp->rvstate);
        if (ret)
                goto out_counter;
@@ -338,7 +338,7 @@ read_verify_schedule_io(
 
        rv = ptvar_get(rvp->rvstate, &ret);
        if (ret)
-               return ret;
+               return -ret;
        req_end = start + length;
        rv_end = rv->io_start + rv->io_length;
 
@@ -386,7 +386,7 @@ force_one_io(
        if (rv->io_length == 0)
                return 0;
 
-       return read_verify_queue(rvp, rv);
+       return -read_verify_queue(rvp, rv);
 }
 
 /* Force any stashed IOs into the verifier. */
@@ -396,7 +396,7 @@ read_verify_force_io(
 {
        assert(rvp->readbuf);
 
-       return ptvar_foreach(rvp->rvstate, force_one_io, rvp);
+       return -ptvar_foreach(rvp->rvstate, force_one_io, rvp);
 }
 
 /* How many bytes has this process verified? */