[PATCH cpu io threads need not have lots of stuff setup
authorJens Axboe <jens.axboe@oracle.com>
Fri, 27 Oct 2006 09:30:07 +0000 (11:30 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 27 Oct 2006 09:30:07 +0000 (11:30 +0200)
Everything that has to do with io can be skipped.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c
init.c
log.c

diff --git a/fio.c b/fio.c
index 234822ee8ecfe9cc7099417af563cbd3aee92277..81e9e90d6ae154477354dbe17ce11637cb65d2c5 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -518,6 +518,9 @@ static int switch_ioscheduler(struct thread_data *td)
        FILE *f;
        int ret;
 
+       if (td->io_ops->flags & FIO_CPUIO)
+               return 0;
+
        sprintf(tmp, "%s/queue/scheduler", td->sysfs_root);
 
        f = fopen(tmp, "r+");
diff --git a/init.c b/init.c
index f27fdf1f03f5bfeb9a85aa690670d1cd2e2d2fda..b0c35f1041ff454ece3dc8b6437ccb1a311426ef 100644 (file)
--- a/init.c
+++ b/init.c
@@ -604,6 +604,9 @@ int init_random_state(struct thread_data *td)
        int fd, num_maps, blocks, i;
        struct fio_file *f;
 
+       if (td->io_ops->flags & FIO_CPUIO)
+               return 0;
+
        fd = open("/dev/urandom", O_RDONLY);
        if (fd == -1) {
                td_verror(td, errno);
diff --git a/log.c b/log.c
index 134355603cb14e417344d5b4058b8a9ee14874cf..b151164760a40042e403bfc422245fe83afdab68 100644 (file)
--- a/log.c
+++ b/log.c
@@ -172,6 +172,9 @@ int init_iolog(struct thread_data *td)
 {
        int ret = 0;
 
+       if (td->io_ops->flags & FIO_CPUIO)
+               return 0;
+
        if (td->read_iolog_file)
                ret = init_iolog_read(td);
        else if (td->write_iolog_file)