[PATCH] ioengine flags: Replace FIO_NETIO with real flags that map the
authorJoel Becker <joel.becker@oracle.com>
Thu, 1 Mar 2007 07:26:38 +0000 (08:26 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 1 Mar 2007 07:26:38 +0000 (08:26 +0100)
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>
engines/net.c
filesetup.c
fio.h
stat.c

index 60a68778b18458d9c49a758833911e779f2b7f99..b3d847bffe97c308ba7ad0294bb17060f6cf35cb 100644 (file)
@@ -269,7 +269,7 @@ static struct ioengine_ops ioengine = {
        .prep           = fio_netio_prep,
        .queue          = fio_netio_queue,
        .setup          = fio_netio_setup,
        .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)
 };
 
 static void fio_init fio_netio_register(void)
index d8135ef08342ce05b0201fdf2fb8e8a8760afc3c..cf9fa3c4fb665f30854b36c2cb25b0dd88f43116 100644 (file)
@@ -347,7 +347,7 @@ static int setup_file(struct thread_data *td, struct fio_file *f)
 {
        int flags = 0;
 
 {
        int flags = 0;
 
-       if (td->io_ops->flags & FIO_NETIO)
+       if (td->io_ops->flags & FIO_SELFOPEN)
                return 0;
 
        /*
                return 0;
 
        /*
diff --git a/fio.h b/fio.h
index 4eabfbcb162f8f298389bb631759670414dc56ce..f8f9a5e458cbe528cd8ef153e50d76da8c0e6193 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -214,8 +214,9 @@ enum fio_ioengine_flags {
        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_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) */
 };
 
 /*
 };
 
 /*
diff --git a/stat.c b/stat.c
index a8f2b02665b2b21f278bcef35af984dc2e61e0d0..ec418da9aa1ff6974fba0e68b08832cf18085aed 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -246,7 +246,7 @@ void init_disk_util(struct thread_data *td)
        dev_t dev;
        char *p;
 
        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;
 
        /*
                return;
 
        /*