blktrace: only probe and set depth if option isn't set
authorJens Axboe <axboe@fb.com>
Thu, 23 Apr 2015 01:54:54 +0000 (19:54 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 23 Apr 2015 01:54:54 +0000 (19:54 -0600)
The comment predates fio's support for checking whether a specific
option was set, we have the power to check this properly now.

Signed-off-by: Jens Axboe <axboe@fb.com>
blktrace.c

index 9afc5be045224165c682e9b71c2ec238cd069c98..e63c7086fcfc2185dfc7b7364aad964707bee8e3 100644 (file)
@@ -456,10 +456,9 @@ int load_blktrace(struct thread_data *td, const char *filename, int need_swap)
        td->o.odirect = 1;
 
        /*
-        * we don't know if this option was set or not. it defaults to 1,
-        * so we'll just guess that we should override it if it's still 1
+        * If depth wasn't manually set, use probed depth
         */
-       if (td->o.iodepth == 1)
+       if (!fio_option_is_set(&td->o, iodepth))
                td->o.iodepth = td->o.iodepth_low = depth;
 
        return 0;