From: Jens Axboe Date: Mon, 8 Jan 2007 09:47:43 +0000 (+0100) Subject: [PATCH] Unlink and directory fix X-Git-Tag: fio-1.11~4 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=8aeebd5570ac4fccbcdd48f2e6f1cf1577f3c08d;p=fio.git [PATCH] Unlink and directory fix Make 'unlink' a bool and fix bug in directory setup. Signed-off-by: Jens Axboe --- diff --git a/HOWTO b/HOWTO index c9d29f29..1b34c283 100644 --- a/HOWTO +++ b/HOWTO @@ -414,7 +414,7 @@ create_serialize=bool If true, serialize the file creating for the jobs. create_fsync=bool fsync the data file after creation. This is the default. -unlink Unlink the job files when done. fio defaults to doing this, +unlink=bool Unlink the job files when done. fio defaults to doing this, if it created the file itself. loops=int Run the specified number of iterations of this job. Used diff --git a/init.c b/init.c index 84226555..bb47c439 100644 --- a/init.c +++ b/init.c @@ -327,7 +327,7 @@ static struct fio_option options[] = { }, { .name = "unlink", - .type = FIO_OPT_STR_SET, + .type = FIO_OPT_INT, .off1 = td_var_offset(unlink), }, { @@ -602,7 +602,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) int len = 0; if (td->directory && td->directory[0] != '\0') - sprintf(tmp, "%s/", td->directory); + len = sprintf(tmp, "%s/", td->directory); td->files = malloc(sizeof(struct fio_file) * td->nr_files); @@ -615,6 +615,7 @@ static int add_job(struct thread_data *td, const char *jobname, int job_add_num) else sprintf(tmp + len, "%s.%d.%d", jobname, td->thread_number, i); f->file_name = strdup(tmp); + fprintf(stderr, "%s\n", f->file_name); } } else { td->nr_files = 1;