Reduntant write bit checks
authorJens Axboe <jens.axboe@oracle.com>
Tue, 17 Apr 2007 13:37:47 +0000 (15:37 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 17 Apr 2007 13:37:47 +0000 (15:37 +0200)
No point in checking for td_rw(td) || td_write(), since td_write()
will also be true for td_rw().

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

index 6ccd357ec4f5d0b9dde6cb92d2691139eeb2aa34..faeefaf308fa3e32107375fed6ac68faf65fe594 100644 (file)
@@ -222,7 +222,7 @@ int generic_open_file(struct thread_data *td, struct fio_file *f)
        if (td->o.sync_io)
                flags |= O_SYNC;
 
        if (td->o.sync_io)
                flags |= O_SYNC;
 
-       if (td_write(td) || td_rw(td)) {
+       if (td_write(td)) {
                flags |= O_RDWR;
 
                if (f->filetype == FIO_TYPE_FILE)
                flags |= O_RDWR;
 
                if (f->filetype == FIO_TYPE_FILE)
diff --git a/fio.c b/fio.c
index c76944568b25d4dbcf23a2e06d4758743544dda6..c39868dd95112a2dea7d3c497e08aeee39953d38 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -641,7 +641,7 @@ static int init_io_u(struct thread_data *td)
                INIT_LIST_HEAD(&io_u->list);
 
                io_u->buf = p + max_bs * i;
                INIT_LIST_HEAD(&io_u->list);
 
                io_u->buf = p + max_bs * i;
-               if (td_write(td) || td_rw(td))
+               if (td_write(td))
                        fill_rand_buf(io_u, max_bs);
 
                io_u->index = i;
                        fill_rand_buf(io_u, max_bs);
 
                io_u->index = i;
diff --git a/io_u.c b/io_u.c
index 0487857e74851b3752d38747b5307fcbebbf4416..d5dd84b96ddf9b00fa89134551fc323bce923eb3 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -654,7 +654,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                add_bw_sample(td, idx, &icd->time);
                io_u_mark_latency(td, msec);
 
                add_bw_sample(td, idx, &icd->time);
                io_u_mark_latency(td, msec);
 
-               if ((td_rw(td) || td_write(td)) && idx == DDIR_WRITE &&
+               if (td_write(td) && idx == DDIR_WRITE &&
                    td->o.verify != VERIFY_NONE)
                        log_io_piece(td, io_u);
 
                    td->o.verify != VERIFY_NONE)
                        log_io_piece(td, io_u);