make the bs info output clearer.
[fio.git] / filesetup.c
index 085d0c89fc9e6381fcc4c3dd05c6e2ddb0864a66..c9f2b5ff9111f7afd1be58446d702bfc2e123d7a 100644 (file)
@@ -447,7 +447,7 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
                        f->file_name);
                ret = td->io_ops->invalidate(td, f);
                if (ret < 0)
-                       errval = ret;
+                       errval = -ret;
        } else if (f->filetype == FIO_TYPE_FILE) {
                dprint(FD_IO, "declare unneeded cache %s: %llu/%llu\n",
                        f->file_name, off, len);
@@ -479,6 +479,8 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
                }
                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);
@@ -492,7 +494,8 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
         * 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;
 
@@ -939,9 +942,6 @@ int setup_files(struct thread_data *td)
                                if (f->file_offset > f->real_file_size)
                                        goto err_offset;
                                f->io_size = f->real_file_size - f->file_offset;
-                               log_info("fio: forcing file %s size to %llu\n",
-                                       f->file_name,
-                                       (unsigned long long)f->io_size);
                                if (!f->io_size)
                                        log_info("fio: file %s may be ignored\n",
                                                f->file_name);