sg: improve sg_write_mode option names
authorVincent Fu <vincent.fu@samsung.com>
Mon, 15 Nov 2021 20:07:17 +0000 (20:07 +0000)
committerJens Axboe <axboe@kernel.dk>
Tue, 18 Jan 2022 13:37:39 +0000 (06:37 -0700)
There is a name collision for the sg_write_mode options for the WRITE AND
VERIFY and VERIFY commands. Deprecate the 'verify' option and use
'write_and_verify' instead. Do the same thing for 'same' and 'write_same' to
have a consistent naming scheme. The original option names are still supported
for backward compatibility but list them as deprecated.

Here are the new sg_write_mode options:

Option SCSI command
write WRITE (default)
write_and_verify WRITE AND VERIFY
verify (deprecated) WRITE AND VERIFY
write_same WRITE SAME
same (deprecated) WRITE SAME
write_same_ndob         WRITE SAME with NDOB flag set
verify_bytchk_00 VERIFY with BYTCHK set to 00
verify_bytchk_01 VERIFY with BYTCHK set to 01
verify_bytchk_11 VERIFY with BYTCHK set to 11

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211115200807.117138-4-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
HOWTO
engines/sg.c
fio.1

diff --git a/HOWTO b/HOWTO
index 370e04aa3f88f4b4b2a3a7d167d22bd2a03d183b..2563bdef24d7de8b679bf06e578688aa2b5a2ff8 100644 (file)
--- a/HOWTO
+++ b/HOWTO
@@ -2496,11 +2496,13 @@ with the caveat that when used on the command line, they must come after the
 
        **write**
                This is the default where write opcodes are issued as usual.
-       **verify**
+       **write_and_verify**
                Issue WRITE AND VERIFY commands. The BYTCHK bit is set to 0. This
                directs the device to carry out a medium verification with no data
                comparison. The writefua option is ignored with this selection.
-       **same**
+       **verify**
+               This option is deprecated. Use write_and_verify instead.
+       **write_same**
                Issue WRITE SAME commands. This transfers a single block to the device
                and writes this same block of data to a contiguous sequence of LBAs
                beginning at the specified offset. fio's block size parameter specifies
@@ -2511,6 +2513,8 @@ with the caveat that when used on the command line, they must come after the
                for each command but only the first 512 bytes will be used and
                transferred to the device. The writefua option is ignored with this
                selection.
+       **same**
+               This option is deprecated. Use write_same instead.
        **write_same_ndob**
                Issue WRITE SAME(16) commands as above but with the No Data Output
                Buffer (NDOB) bit set. No data will be transferred to the device with
index 3c4e986de734f443598467708f7c91b1c03f6bcb..d15b438fdc1a067a252ce0379ddcbb20c836d656 100644 (file)
@@ -124,14 +124,24 @@ static struct fio_option options[] = {
                            .oval = FIO_SG_WRITE,
                            .help = "Issue standard SCSI WRITE commands",
                          },
-                         { .ival = "verify",
+                         { .ival = "write_and_verify",
                            .oval = FIO_SG_WRITE_VERIFY,
                            .help = "Issue SCSI WRITE AND VERIFY commands",
                          },
-                         { .ival = "same",
+                         { .ival = "verify",
+                           .oval = FIO_SG_WRITE_VERIFY,
+                           .help = "Issue SCSI WRITE AND VERIFY commands. This "
+                                   "option is deprecated. Use write_and_verify instead.",
+                         },
+                         { .ival = "write_same",
                            .oval = FIO_SG_WRITE_SAME,
                            .help = "Issue SCSI WRITE SAME commands",
                          },
+                         { .ival = "same",
+                           .oval = FIO_SG_WRITE_SAME,
+                           .help = "Issue SCSI WRITE SAME commands. This "
+                                   "option is deprecated. Use write_same instead.",
+                         },
                          { .ival = "write_same_ndob",
                            .oval = FIO_SG_WRITE_SAME_NDOB,
                            .help = "Issue SCSI WRITE SAME(16) commands with NDOB flag set",
diff --git a/fio.1 b/fio.1
index 5a66e32680e65be68281efe5fd17bdbbe6740214..48baebc5020bc00393dd7a3450bffd30c89a1f7c 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -2292,12 +2292,15 @@ values:
 .B write (default)
 Write opcodes are issued as usual
 .TP
-.B verify
+.B write_and_verify
 Issue WRITE AND VERIFY commands. The BYTCHK bit is set to 00b. This directs the
 device to carry out a medium verification with no data comparison for the data
 that was written. The writefua option is ignored with this selection.
 .TP
-.B same
+.B verify
+This option is deprecated. Use write_and_verify instead.
+.TP
+.B write_same
 Issue WRITE SAME commands. This transfers a single block to the device
 and writes this same block of data to a contiguous sequence of LBAs
 beginning at the specified offset. fio's block size parameter
@@ -2309,6 +2312,9 @@ generate 8k of data for each command butonly the first 512 bytes will
 be used and transferred to the device. The writefua option is ignored
 with this selection.
 .TP
+.B same
+This option is deprecated. Use write_same instead.
+.TP
 .B write_same_ndob
 Issue WRITE SAME(16) commands as above but with the No Data Output
 Buffer (NDOB) bit set. No data will be transferred to the device with