filesetup: don't skip flags for trim workloads
authorVincent Fu <vincent.fu@samsung.com>
Fri, 17 Feb 2023 18:22:10 +0000 (13:22 -0500)
committerVincent Fu <vincent.fu@samsung.com>
Fri, 17 Feb 2023 18:22:10 +0000 (13:22 -0500)
Fio has not been setting O_DIRECT, O_SYNC, O_DSYNC, and O_CREAT for
workloads that include trim commands. Stop doing this and actually set
these flags when requested for workloads that include trim commands.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
filesetup.c

index 1836d7e2a10540014947a6a8df5b935306af1ee4..648f48c6289169e2faa7da36f7f1a96839e030ca 100644 (file)
@@ -737,14 +737,11 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
                        f_out = stderr;
        }
 
-       if (td_trim(td))
-               goto skip_flags;
        if (td->o.odirect)
                flags |= OS_O_DIRECT;
        flags |= td->o.sync_io;
        if (td->o.create_on_open && td->o.allow_create)
                flags |= O_CREAT;
-skip_flags:
        if (f->filetype != FIO_TYPE_FILE)
                flags |= FIO_O_NOATIME;