behavior
The FIO_NETIO ioengine flag created two behaviors. First, open_files()
would not open any files - this was handled in engines/net:setup().
Second, init_disk_util() would ignore the files and not try to locate
their disk.
Other engines might want one of these behaviors but not the other. If
an engine opens its own files, it doesn't want open_files() to do anything,
even if the files are eventually disk-based. An engine might want to
prevent init_disk_util() from running.
The FIO_NETIO flag is split into two flags.
FIO_SELFOPEN states that the engine will do its own open(), whether it
is a real open(2) or something internal to the engine.
FIO_DISKLESSIO states that init_disk_util() is should not be run. fio
should treat the engine's files as if they are not part of a disk.
Finally, engines/net.c is changed to use these two flags.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
.prep = fio_netio_prep,
.queue = fio_netio_queue,
.setup = fio_netio_setup,
- .flags = FIO_SYNCIO | FIO_NETIO,
+ .flags = FIO_SYNCIO | FIO_DISKLESSIO | FIO_SELFOPEN,
};
static void fio_init fio_netio_register(void)
{
int flags = 0;
- if (td->io_ops->flags & FIO_NETIO)
+ if (td->io_ops->flags & FIO_SELFOPEN)
return 0;
/*
FIO_CPUIO = 1 << 1, /* cpu burner, doesn't do real io */
FIO_MMAPIO = 1 << 2, /* uses memory mapped io */
FIO_RAWIO = 1 << 3, /* some sort of direct/raw io */
- FIO_NETIO = 1 << 4, /* networked io */
- FIO_NULLIO = 1 << 5, /* no real data transfer (cpu/null) */
+ FIO_DISKLESSIO = 1 << 4, /* no disk involved */
+ FIO_SELFOPEN = 1 << 5, /* opens its own devices */
+ FIO_NULLIO = 1 << 6, /* no real data transfer (cpu/null) */
};
/*
dev_t dev;
char *p;
- if (!td->do_disk_util || (td->io_ops->flags & (FIO_NETIO | FIO_NULLIO)))
+ if (!td->do_disk_util || (td->io_ops->flags & (FIO_DISKLESSIO | FIO_NULLIO)))
return;
/*