projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
parse: get rid of raw option offsets
[fio.git]
/
options.c
diff --git
a/options.c
b/options.c
index 57e9af5b4676296f22a1aee8a97fd379826afb53..5ee70befced30f6729f6684b725d5493c9ca22ae 100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-821,6
+821,18
@@
static int str_directory_cb(void *data, const char fio_unused *str)
return 0;
}
return 0;
}
+static int str_lockfile_cb(void *data, const char fio_unused *str)
+{
+ struct thread_data *td = data;
+
+ if (td->files_index) {
+ log_err("fio: lockfile= option must precede filename=\n");
+ return 1;
+ }
+
+ return 0;
+}
+
static int str_opendir_cb(void *data, const char fio_unused *str)
{
struct thread_data *td = data;
static int str_opendir_cb(void *data, const char fio_unused *str)
{
struct thread_data *td = data;
@@
-1231,6
+1243,7
@@
struct fio_option fio_options[FIO_MAX_OPTS] = {
.parent = "filename",
.hide = 0,
.def = "none",
.parent = "filename",
.hide = 0,
.def = "none",
+ .cb = str_lockfile_cb,
.category = FIO_OPT_C_FILE,
.group = FIO_OPT_G_FILENAME,
.posval = {
.category = FIO_OPT_C_FILE,
.group = FIO_OPT_G_FILENAME,
.posval = {
@@
-3773,7
+3786,13
@@
int add_option(struct fio_option *o)
__o++;
}
__o++;
}
+ if (opt_index + 1 == FIO_MAX_OPTS) {
+ log_err("fio: FIO_MAX_OPTS is too small\n");
+ return 1;
+ }
+
memcpy(&fio_options[opt_index], o, sizeof(*o));
memcpy(&fio_options[opt_index], o, sizeof(*o));
+ fio_options[opt_index + 1].name = NULL;
return 0;
}
return 0;
}