Add support for POSIX_FADV_STREAMID
[fio.git] / ioengines.c
index 00098d6739daf8da3183476e98927395cba20e8c..b42e2c48c7a5d4fe9f660b49a136fc88b69aa06f 100644 (file)
@@ -468,6 +468,17 @@ int td_io_open_file(struct thread_data *td, struct fio_file *f)
                        goto err;
                }
        }
+#ifdef FIO_HAVE_STREAMID
+       if (td->o.fadvise_stream &&
+           (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_FILE)) {
+               off_t stream = td->o.fadvise_stream;
+
+               if (posix_fadvise(f->fd, stream, f->io_size, POSIX_FADV_STREAMID) < 0) {
+                       td_verror(td, errno, "fadvise streamid");
+                       goto err;
+               }
+       }
+#endif
 
 #ifdef FIO_OS_DIRECTIO
        /*