From: Jens Axboe Date: Mon, 24 Sep 2012 13:00:55 +0000 (+0200) Subject: Merge branch 'master' into gfio X-Git-Tag: fio-2.1~57^2~58 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=f982d35f5ae88f728c6853aaf57448db8f5fcf98;hp=b999b3c74daa2dedd398544e898b54d8b221314c Merge branch 'master' into gfio --- diff --git a/backend.c b/backend.c index 3600319b..6f400387 100644 --- a/backend.c +++ b/backend.c @@ -802,6 +802,7 @@ static int init_io_u(struct thread_data *td) struct io_u *io_u; unsigned int max_bs, min_write; int cl_align, i, max_units; + int data_xfer = 1; char *p; max_units = td->o.iodepth; @@ -811,6 +812,9 @@ static int init_io_u(struct thread_data *td) td->orig_buffer_size = (unsigned long long) max_bs * (unsigned long long) max_units; + if ((td->io_ops->flags & FIO_NOIO) || !td_rw(td)) + data_xfer = 0; + if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) { unsigned long bs; @@ -823,7 +827,7 @@ static int init_io_u(struct thread_data *td) return 1; } - if (allocate_io_mem(td)) + if (data_xfer && allocate_io_mem(td)) return 1; if (td->o.odirect || td->o.mem_align || @@ -851,7 +855,7 @@ static int init_io_u(struct thread_data *td) INIT_FLIST_HEAD(&io_u->list); dprint(FD_MEM, "io_u alloc %p, index %u\n", io_u, i); - if (!(td->io_ops->flags & FIO_NOIO)) { + if (data_xfer) { io_u->buf = p; dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf); diff --git a/parse.c b/parse.c index 419e80f8..9a6494f3 100644 --- a/parse.c +++ b/parse.c @@ -429,13 +429,13 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data, break; if (o->maxval && ull > o->maxval) { - log_err("max value out of range: %lld" - " (%d max)\n", ull, o->maxval); + log_err("max value out of range: %llu" + " (%u max)\n", ull, o->maxval); return 1; } if (o->minval && ull < o->minval) { - log_err("min value out of range: %lld" - " (%d min)\n", ull, o->minval); + log_err("min value out of range: %llu" + " (%u min)\n", ull, o->minval); return 1; } @@ -1085,6 +1085,10 @@ void option_init(struct fio_option *o) o->minval = 0; o->maxval = 1; } + if (o->type == FIO_OPT_INT) { + if (!o->maxval) + o->maxval = UINT_MAX; + } if (o->type == FIO_OPT_FLOAT_LIST) { o->minfp = NAN; o->maxfp = NAN;