zbd: avoid initializing swd when unnecessary
authorNaohiro Aota <naohiro.aota@wdc.com>
Fri, 28 Feb 2020 07:12:43 +0000 (16:12 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Mar 2020 02:05:54 +0000 (20:05 -0600)
When enable_check_swd == false, there is no use to initialize swd. Just
disable it in this case.

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Tested-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
zbd.c

diff --git a/zbd.c b/zbd.c
index ee8bcb3..ddf1e6f 100644 (file)
--- a/zbd.c
+++ b/zbd.c
@@ -847,6 +847,9 @@ static void zbd_init_swd(struct fio_file *f)
 {
        uint64_t swd;
 
+       if (!enable_check_swd)
+               return;
+
        swd = zbd_process_swd(f, SET_SWD);
        dprint(FD_ZBD, "%s(%s): swd = %" PRIu64 "\n", __func__, f->file_name,
               swd);