Add support for O_ATOMIC
[fio.git] / filesetup.c
index 4265e3830a73c57f0f3a1c1d24e87db6b3344d9a..c9b060b7e8aba6b8cad4c498d3ee6736caaa6dc0 100644 (file)
@@ -519,6 +519,13 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
                goto skip_flags;
        if (td->o.odirect)
                flags |= OS_O_DIRECT;
+       if (td->o.oatomic) {
+               if (!FIO_O_ATOMIC) {
+                       td_verror(td, EINVAL, "OS does not support atomic IO");
+                       return 1;
+               }
+               flags |= OS_O_DIRECT | FIO_O_ATOMIC;
+       }
        if (td->o.sync_io)
                flags |= O_SYNC;
        if (td->o.create_on_open)