filesetup: don't print non-debug error on native fallocate failure
authorJens Axboe <axboe@kernel.dk>
Thu, 2 Nov 2017 14:53:54 +0000 (08:53 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 Nov 2017 14:53:54 +0000 (08:53 -0600)
We expect this to fail in cases where it isn't available, so don't
clutter the standard/error output with it.

Also ensure that native_fallocate() returns true/false, since it's
a bool function. Just a cleanup, no functional change there.

Fixes: 2c3e17be4c7c ("filesetup: add native fallocate")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c

index 5d7ea5c02e17b10357aea99a998bd885901f7bad..6bc0b8bf5dc2f42171a98582f2752708c7ee3fcc 100644 (file)
@@ -49,12 +49,12 @@ static inline int native_fallocate(struct thread_data *td, struct fio_file *f)
                        !success ? "un": "");
 
        if (success)
-               return 0;
+               return false;
 
        if (errno == ENOSYS)
                dprint(FD_FILE, "native fallocate is not implemented\n");
 
-       return -1;
+       return true;
 }
 
 static void fallocate_file(struct thread_data *td, struct fio_file *f)
@@ -66,10 +66,7 @@ static void fallocate_file(struct thread_data *td, struct fio_file *f)
 
        switch (td->o.fallocate_mode) {
        case FIO_FALLOCATE_NATIVE:
-               r = native_fallocate(td, f);
-               if (r != 0 && errno != ENOSYS)
-                       log_err("fio: native_fallocate call failed: %s\n",
-                                       strerror(errno));
+               native_fallocate(td, f);
                break;
        case FIO_FALLOCATE_NONE:
                break;