[PATCH] Kill ->cur_off, always just lseek() in sync ->io_prep
authorJens Axboe <axboe@suse.de>
Thu, 8 Dec 2005 19:09:36 +0000 (20:09 +0100)
committerJens Axboe <axboe@suse.de>
Thu, 8 Dec 2005 19:09:36 +0000 (20:09 +0100)
fio-io.c
fio.c
fio.h

index 3183e8fd56220aa6064c3b41439e3c1abd4adb18..dee02ab5e067ba8bf74188d56f429f00a361b129 100644 (file)
--- a/fio-io.c
+++ b/fio-io.c
@@ -352,11 +352,9 @@ static struct io_u *fio_syncio_event(struct thread_data *td, int event)
 
 static int fio_syncio_prep(struct thread_data *td, struct io_u *io_u)
 {
-       if (td->cur_off != io_u->offset) {
-               if (lseek(td->fd, io_u->offset, SEEK_SET) == -1) {
-                       td_verror(td, errno);
-                       return 1;
-               }
+       if (lseek(td->fd, io_u->offset, SEEK_SET) == -1) {
+               td_verror(td, errno);
+               return 1;
        }
 
        return 0;
diff --git a/fio.c b/fio.c
index 6f122c9bbd0c68692df441d3c1edcf317145771e..c93cbe266c852930744fededf4144c82c2317be4 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -897,8 +897,6 @@ static void do_verify(struct thread_data *td)
                        break;
                }
 
-               td->cur_off = v_io_u->offset + v_io_u->buflen;
-
                /*
                 * if we can't submit more io, we need to verify now
                 */
@@ -1609,7 +1607,6 @@ static void clear_io_state(struct thread_data *td)
        if (td->io_engine == FIO_SYNCIO)
                lseek(td->fd, SEEK_SET, 0);
 
-       td->cur_off = 0;
        td->last_bytes = 0;
        td->stat_io_bytes[0] = td->stat_io_bytes[1] = 0;
        td->this_io_bytes[0] = td->this_io_bytes[1] = 0;
diff --git a/fio.h b/fio.h
index dbce4af347ec34ae85d93b0e2242256c5f957b39..f1e49a50cd86aa74ba7e5c4b46d475f5d76096ed 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -148,8 +148,6 @@ struct thread_data {
 
        int shm_id;
 
-       unsigned long long cur_off;
-
        void *io_data;
        char io_engine_name[16];
        int (*io_prep)(struct thread_data *, struct io_u *);