A trim workload doesn't transfer any actual data, so don't any
backing memory for the IO buffers.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
struct io_u *io_u;
unsigned int max_bs, min_write;
int cl_align, i, max_units;
struct io_u *io_u;
unsigned int max_bs, min_write;
int cl_align, i, max_units;
char *p;
max_units = td->o.iodepth;
char *p;
max_units = td->o.iodepth;
td->orig_buffer_size = (unsigned long long) max_bs
* (unsigned long long) max_units;
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;
if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {
unsigned long bs;
- if (allocate_io_mem(td))
+ if (data_xfer && allocate_io_mem(td))
return 1;
if (td->o.odirect || td->o.mem_align ||
return 1;
if (td->o.odirect || td->o.mem_align ||
INIT_FLIST_HEAD(&io_u->list);
dprint(FD_MEM, "io_u alloc %p, index %u\n", io_u, i);
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)) {
io_u->buf = p;
dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf);
io_u->buf = p;
dprint(FD_MEM, "io_u %p, mem %p\n", io_u, io_u->buf);