No need to use specific flag for io_u fill length
authorRadha Ramachandran <radha@google.com>
Wed, 14 Jul 2010 23:39:05 +0000 (17:39 -0600)
committerJens Axboe <jaxboe@fusionio.com>
Wed, 14 Jul 2010 23:39:05 +0000 (17:39 -0600)
The fill length already provides that information.

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
io_u.c
ioengine.h
verify.c

diff --git a/io_u.c b/io_u.c
index 88b2b9f32a844aaffb11e5d4e5c2fc95951a4890..f27cddacf95f881792d392f7ca4097a1781e496d 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -988,7 +988,6 @@ struct io_u *get_io_u(struct thread_data *td)
                         * Reset the buf_filled parameters so next time if the
                         * buffer is used for writes it is refilled.
                         */
-                       io_u->flags &= ~IO_U_F_FILLED;
                        io_u->buf_filled_len = 0;
                }
        }
index 343b06fb3601711ae190037c497c128ed9df93f7..e9f5d9273563db2bf3de35e998dd637cf155630b 100644 (file)
@@ -8,7 +8,6 @@ enum {
        IO_U_F_FLIGHT           = 1 << 1,
        IO_U_F_FREE_DEF         = 1 << 2,
        IO_U_F_IN_CUR_DEPTH     = 1 << 3,
-       IO_U_F_FILLED           = 1 << 4,
 };
 
 /*
index 098c19bcafc38d7f5e994ac80acec566245b660d..42ea462f0cf656d18a47e404e8d13a13a8dbd0ab 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -30,22 +30,19 @@ void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u
                fill_random_buf(p, len);
                break;
        case 1:
-               if ((io_u->flags & IO_U_F_FILLED) &&
-                    io_u->buf_filled_len >= len) {
+               if (io_u->buf_filled_len >= len) {
                        dprint(FD_VERIFY, "using already filled verify pattern b=0 len=%u\n", len);
                        return;
                }
                dprint(FD_VERIFY, "fill verify pattern b=0 len=%u\n", len);
                memset(p, td->o.verify_pattern[0], len);
-               io_u->flags |= IO_U_F_FILLED;
                io_u->buf_filled_len = len;
                break;
        default: {
                unsigned int i = 0, size = 0;
                unsigned char *b = p;
 
-               if ((io_u->flags & IO_U_F_FILLED) &&
-                    io_u->buf_filled_len >= len) {
+               if (io_u->buf_filled_len >= len) {
                        dprint(FD_VERIFY, "using already filled verify pattern b=%d len=%u\n",
                                        td->o.verify_pattern_bytes, len);
                        return;
@@ -60,7 +57,6 @@ void fill_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u
                        memcpy(b+i, td->o.verify_pattern, size);
                        i += size;
                }
-               io_u->flags |= IO_U_F_FILLED;
                io_u->buf_filled_len = len;
                break;
                }