Use ENOTSUP if OS doesn't support blkdev page cache invalidation
[fio.git] / filesetup.c
index 085d0c89fc9e6381fcc4c3dd05c6e2ddb0864a66..b04fb3e9b89362d1012883f594d9e6c7943e9fb3 100644 (file)
@@ -479,6 +479,8 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
                }
                if (ret < 0)
                        errval = errno;
                }
                if (ret < 0)
                        errval = errno;
+               else if (ret) /* probably not supported */
+                       errval = ret;
        } else if (f->filetype == FIO_TYPE_CHAR ||
                   f->filetype == FIO_TYPE_PIPE) {
                dprint(FD_IO, "invalidate not supported %s\n", f->file_name);
        } else if (f->filetype == FIO_TYPE_CHAR ||
                   f->filetype == FIO_TYPE_PIPE) {
                dprint(FD_IO, "invalidate not supported %s\n", f->file_name);
@@ -492,7 +494,8 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
         * continue on our way.
         */
        if (errval)
         * continue on our way.
         */
        if (errval)
-               log_info("fio: cache invalidation of %s failed: %s\n", f->file_name, strerror(errval));
+               log_info("fio: cache invalidation of %s failed: %s\n",
+                        f->file_name, strerror(errval));
 
        return 0;
 
 
        return 0;