From: Jens Axboe Date: Tue, 9 Mar 2010 19:41:15 +0000 (+0100) Subject: Make sure we handle multiple arguments to sync_file_range X-Git-Tag: fio-1.38~24 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=3843deb322eb7b54d2d19d7b1ce19c5dc44d57ff Make sure we handle multiple arguments to sync_file_range We need to be able to OR the values. Signed-off-by: Jens Axboe --- diff --git a/ioengines.c b/ioengines.c index 0e895340..de934971 100644 --- a/ioengines.c +++ b/ioengines.c @@ -439,8 +439,8 @@ int do_sync_file_range(struct thread_data *td, struct fio_file *f) offset = f->first_write; nbytes = f->last_write - f->first_write; - if (nbytes) - return sync_file_range(f->fd, offset, nbytes, 0); + if (!nbytes) + return 0; - return 0; + return sync_file_range(f->fd, offset, nbytes, td->o.sync_file_range); } diff --git a/options.c b/options.c index bee15cf9..dda7cba1 100644 --- a/options.c +++ b/options.c @@ -1131,18 +1131,21 @@ static struct fio_option options[FIO_MAX_OPTS] = { { .ival = "wait_before", .oval = SYNC_FILE_RANGE_WAIT_BEFORE, .help = "SYNC_FILE_RANGE_WAIT_BEFORE", + .or = 1, }, { .ival = "write", .oval = SYNC_FILE_RANGE_WRITE, .help = "SYNC_FILE_RANGE_WRITE", + .or = 1, }, { .ival = "wait_after", .oval = SYNC_FILE_RANGE_WAIT_AFTER, .help = "SYNC_FILE_RANGE_WAIT_AFTER", + .or = 1, }, }, - .type = FIO_OPT_STR, + .type = FIO_OPT_STR_MULTI, .cb = str_sfr_cb, .off1 = td_var_offset(sync_file_range), .help = "Use sync_file_range()",