projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add 'fsync_on_close' option
[fio.git]
/
init.c
diff --git
a/init.c
b/init.c
index a3d1d5a87e9fe1c0b7d87d2e0b49a0a744989f53..cf66ec0e8ee9875ded959cb616be5c633c4e13fc 100644
(file)
--- a/
init.c
+++ b/
init.c
@@
-499,6
+499,13
@@
static struct fio_option options[] = {
.help = "Include fsync at the end of job",
.def = "0",
},
.help = "Include fsync at the end of job",
.def = "0",
},
+ {
+ .name = "fsync_on_close",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(fsync_on_close),
+ .help = "fsync files on close",
+ .def = "0",
+ },
{
.name = "unlink",
.type = FIO_OPT_BOOL,
{
.name = "unlink",
.type = FIO_OPT_BOOL,
@@
-753,8
+760,11
@@
static void fixup_options(struct thread_data *td)
td->iodepth_batch = td->iodepth;
if (!td->nr_files)
td->iodepth_batch = td->iodepth;
if (!td->nr_files)
- td->nr_files = td->open_files;
- else if (td->open_files > td->nr_files || !td->open_files)
+ td->nr_files = td->files_index;
+ else if (td->nr_files > td->files_index)
+ td->nr_files = td->files_index;
+
+ if (td->open_files > td->nr_files || !td->open_files)
td->open_files = td->nr_files;
}
td->open_files = td->nr_files;
}
@@
-1106,9
+1116,6
@@
static int str_filename_cb(void *data, const char *input)
struct thread_data *td = data;
char *fname, *str, *p;
struct thread_data *td = data;
char *fname, *str, *p;
- if (!td->filename)
- td->nr_files = 0;
-
p = str = strdup(input);
strip_blank_front(&str);
p = str = strdup(input);
strip_blank_front(&str);
@@
-1118,7
+1125,6
@@
static int str_filename_cb(void *data, const char *input)
if (!strlen(fname))
break;
add_file(td, fname);
if (!strlen(fname))
break;
add_file(td, fname);
- td->nr_files++;
}
free(p);
}
free(p);