From: Jens Axboe Date: Thu, 2 Nov 2017 14:53:54 +0000 (-0600) Subject: filesetup: don't print non-debug error on native fallocate failure X-Git-Tag: fio-3.2~13 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c0aabe37db1bde7def7961f91bf65d8d147c367a;p=fio.git 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 --- 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;