Fix conditional/message for max lba for sg ioengine
authorTomohiro Kusumi <tkusumi@tuxera.com>
Mon, 9 Jan 2017 14:42:00 +0000 (23:42 +0900)
committerJens Axboe <axboe@fb.com>
Mon, 9 Jan 2017 15:39:20 +0000 (08:39 -0700)
Whether sg ioengine uses 10 or 16 bytes read/write command (by 5ad7be56)
is determined by ->prep() depending on lba to read/write vs 0xFFFFFFFFULL,
so let the message show it depends.

Also remove unused sgio_data::max_lba which is essentially the same
(divide by bs minus 1) as fio_file::real_file_size.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
engines/sg.c

index c9a14483946e527228b325d15093a66f1b563df2..00bf3039ac30fe63df44b3ac63a9fe3e7e219eef 100644 (file)
@@ -32,7 +32,6 @@ struct sgio_data {
        int *fd_flags;
        void *sgbuf;
        unsigned int bs;
        int *fd_flags;
        void *sgbuf;
        unsigned int bs;
-       long long max_lba;
        int type_checked;
 };
 
        int type_checked;
 };
 
@@ -535,9 +534,10 @@ static int fio_sgio_type_check(struct thread_data *td, struct fio_file *f)
 
        sd->bs = bs;
        // Determine size of commands needed based on max_lba
 
        sd->bs = bs;
        // Determine size of commands needed based on max_lba
-       sd->max_lba = max_lba;
-       if (max_lba > MAX_10B_LBA) {
-               dprint(FD_IO, "sgio_type_check: using 16 byte operations: max_lba = 0x%016llx\n", max_lba);
+       if (max_lba >= MAX_10B_LBA) {
+               dprint(FD_IO, "sgio_type_check: using 16 byte read/write "
+                       "commands for lba above 0x%016llx/0x%016llx\n",
+                       MAX_10B_LBA, max_lba);
        }
 
 
        }