[PATCH] fio: kill max_depth print and fix for error handling in async io
authorJens Axboe <axboe@suse.de>
Fri, 21 Oct 2005 12:24:16 +0000 (14:24 +0200)
committerJens Axboe <axboe@suse.de>
Fri, 21 Oct 2005 12:24:16 +0000 (14:24 +0200)
fio.c

diff --git a/fio.c b/fio.c
index ebb64664cfa3c6223df58cd24a14ae43c158d05a..ace14b7c655e872f37198673715dea11eb806edf 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -509,7 +509,6 @@ static void do_async_io(struct thread_data *td)
        struct timeval s, e;
        char *buf, *ptr;
        unsigned long blocks, msec, usec;
-       int max_depth = 0;
 
        ptr = malloc(td->bs * td->aio_depth + MASK);
        buf = ALIGN(ptr);
@@ -522,8 +521,8 @@ static void do_async_io(struct thread_data *td)
        for (blocks = 0; blocks < td->blocks; blocks++) {
                struct timespec ts = { .tv_sec = 0, .tv_nsec = 0};
                struct timespec *timeout;
-               struct iocb *iocb = aio_get_iocb(td, buf);
                int ret, i, min_evts = 0;
+               struct iocb *iocb;
 
                if (td->terminate)
                        break;
@@ -533,6 +532,8 @@ static void do_async_io(struct thread_data *td)
 
                gettimeofday(&s, NULL);
 
+               iocb = aio_get_iocb(td, buf);
+
                ret = io_submit(*td->aio_ctx, 1, &iocb);
                if (ret < 0) {
                        td->error = errno;
@@ -540,10 +541,6 @@ static void do_async_io(struct thread_data *td)
                }
 
                td->aio_cur_depth++;
-               if (td->aio_cur_depth > max_depth) {
-                       max_depth = td->aio_cur_depth;
-                       printf("max now %d\n", max_depth);
-               }
 
                if (td->aio_cur_depth < td->aio_depth) {
                        timeout = &ts;