Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Please enter the commit message for your changes. Lines starting
create_fsync=bool fsync the data file after creation. This is the
default.
create_fsync=bool fsync the data file after creation. This is the
default.
+create_on_open=bool Don't pre-setup the files for IO, just create open()
+ when it's time to do IO to that file.
+
unlink=bool Unlink the job files when done. Not the default, as repeated
runs of that job would then waste time recreating the file
set again and again.
unlink=bool Unlink the job files when done. Not the default, as repeated
runs of that job would then waste time recreating the file
set again and again.
flags |= O_SYNC;
if (f->filetype != FIO_TYPE_FILE)
flags |= FIO_O_NOATIME;
flags |= O_SYNC;
if (f->filetype != FIO_TYPE_FILE)
flags |= FIO_O_NOATIME;
+ if (td->o.create_on_open)
+ flags |= O_CREAT;
open_again:
if (td_write(td)) {
open_again:
if (td_write(td)) {
if (f->filetype == FIO_TYPE_FILE &&
(f->io_size + f->file_offset) > f->real_file_size &&
!(td->io_ops->flags & FIO_DISKLESSIO)) {
if (f->filetype == FIO_TYPE_FILE &&
(f->io_size + f->file_offset) > f->real_file_size &&
!(td->io_ops->flags & FIO_DISKLESSIO)) {
- need_extend++;
- extend_size += (f->io_size + f->file_offset);
+ if (!td->o.create_on_open) {
+ need_extend++;
+ extend_size += (f->io_size + f->file_offset);
+ } else
+ f->real_file_size = f->io_size + f->file_offset;
f->flags |= FIO_FILE_EXTEND;
}
}
f->flags |= FIO_FILE_EXTEND;
}
}
unsigned int invalidate_cache;
unsigned int create_serialize;
unsigned int create_fsync;
unsigned int invalidate_cache;
unsigned int create_serialize;
unsigned int create_fsync;
+ unsigned int create_on_open;
unsigned int end_fsync;
unsigned int sync_io;
unsigned int verify;
unsigned int end_fsync;
unsigned int sync_io;
unsigned int verify;
.help = "Fsync file after creation",
.def = "1",
},
.help = "Fsync file after creation",
.def = "1",
},
+ {
+ .name = "create_on_open",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(create_on_open),
+ .help = "Create files when they are opened for IO",
+ .def = "0",
+ },
{
.name = "cpuload",
.type = FIO_OPT_INT,
{
.name = "cpuload",
.type = FIO_OPT_INT,