X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=a1f8756d086ca5d06c5e1de063ec702f8294a228;hp=ae55f951d413fbaeaf92dae3c8eb0746167d4c9d;hb=efa72f25ae594fd1d7f8f1b207f95143a917d8f2;hpb=78475ac3b9453eff01c34778d70a2aed4aecffe8 diff --git a/ioengines.c b/ioengines.c index ae55f951..a1f8756d 100644 --- a/ioengines.c +++ b/ioengines.c @@ -298,6 +298,7 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u) td->io_issues[ddir]--; td->io_issue_bytes[ddir] -= buflen; td->rate_io_issue_bytes[ddir] -= buflen; + io_u_clear(td, io_u, IO_U_F_FLIGHT); } /* @@ -447,14 +448,24 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) if (td->o.invalidate_cache && file_invalidate_cache(td, f)) goto err; - if (td->o.fadvise_hint && + if (td->o.fadvise_hint != F_ADV_NONE && (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_FILE)) { int flags; - if (td_random(td)) + if (td->o.fadvise_hint == F_ADV_TYPE) { + if (td_random(td)) + flags = POSIX_FADV_RANDOM; + else + flags = POSIX_FADV_SEQUENTIAL; + } else if (td->o.fadvise_hint == F_ADV_RANDOM) flags = POSIX_FADV_RANDOM; - else + else if (td->o.fadvise_hint == F_ADV_SEQUENTIAL) flags = POSIX_FADV_SEQUENTIAL; + else { + log_err("fio: unknown fadvise type %d\n", + td->o.fadvise_hint); + flags = POSIX_FADV_NORMAL; + } if (posix_fadvise(f->fd, f->file_offset, f->io_size, flags) < 0) { td_verror(td, errno, "fadvise"); @@ -483,7 +494,12 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f) if (ret) { td_verror(td, ret, "fio_set_odirect"); - log_err("fio: the file system does not seem to support direct IO\n"); + if (ret == ENOTTY) { /* ENOTTY suggests RAW device or ZFS */ + log_err("fio: doing directIO to RAW devices or ZFS not supported\n"); + } else { + log_err("fio: the file system does not seem to support direct IO\n"); + } + goto err; } }