summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2017-11-02 08:53:54 -0600
committerJens Axboe <axboe@kernel.dk>2017-11-02 08:53:54 -0600
commitc0aabe37db1bde7def7961f91bf65d8d147c367a (patch)
tree20974f3c06d798f83a1f8b2dc1ed3635be329977
parentc89daa4a98e6f3749ffc75b727a77cc061a0a454 (diff)
downloadfio-c0aabe37db1bde7def7961f91bf65d8d147c367a.tar.gz
filesetup: don't print non-debug error on native fallocate failure
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>
-rw-r--r--filesetup.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/filesetup.c b/filesetup.c
index 5d7ea5c0..6bc0b8bf 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -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;