scsi: scsi_debug: Maintain write statistics per group number
authorBart Van Assche <bvanassche@acm.org>
Tue, 30 Jan 2024 21:48:45 +0000 (13:48 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 27 Feb 2024 02:37:27 +0000 (21:37 -0500)
commitaf180c0880f9df14be31807f0bb0fa6f0d34a943
tree630e25c1c3e77fe8032b0798afc44a1b13835392
parentad620becda436fc02e50e5f6fe01de1d1f3794c9
scsi: scsi_debug: Maintain write statistics per group number

Track per GROUP NUMBER how many write commands have been processed. Make
this information available in sysfs. Reset these statistics if any data
is written into the sysfs attribute.

Note: SCSI devices should only interpret the information in the GROUP
NUMBER field as a stream identifier if the ST_ENBLE bit has been set to
one. This patch follows a simpler approach: count the number of writes
per GROUP NUMBER whether or not the group number represents a stream
identifier.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Tested-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240130214911.1863909-20-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c