From: Damien Le Moal
For a zoned block device, sd_zbc_complete() handles zone write unlock
on completion of a REQ_OP_WRITE_ZEROES command but the zone write
locking is missing from sd_setup_write_zeroes_cmnd(). This patch fixes
this problem by locking the target zone of a
From: Damien Le Moal
For a zoned block device, sd_zbc_complete() handles zone write unlock on
completion of a REQ_OP_WRITE_ZEROES command but the zone write locking is
missing from sd_setup_write_zeroes_cmnd(). This patch fixes this problem by
locking the target zone of a
From: Damien Le Moal
scsi_io_init() may fail, leaving a zone of a zoned block device locked.
Fix this by properly unlocking the write same request target zone if
scsi_io_init() fails.
Signed-off-by: Damien Le Moal
Cc: sta...@vger.kernel.org
---
From: Bart Van Assche
A value is assigned to the variable 'capacity' in sd_zbc_read_zones()
but that value is never used. Hence remove the variable 'capacity'.
[Damien: There is no need to initialize to 0 the variable 'ret'
in sd_zbc_read_zones()]
Signed-off-by:
From: Damien Le Moal
Resetting a zone write pointer is equivalent to discarding sectors:
after a reset, the zone sectors will contain zeros (or the format
pattern). So there is no need for mutual exclusion between a zone reset
and write. Similarly to discard, make it the
From: Damien Le Moal
Rename sd_zbc_setup_write_cmnd() to sd_zbc_write_lock_zone() to be
clear about what the function actually does. To be consistent, also
rename sd_zbc_cancel_write_cmnd() to sd_zbc_write_unlock_zone().
No functional change is introduced by this patch.
From: Damien Le Moal
In sd_done(), for the ILLEGAL REQUEST sense key case, add an 'else if'
after the first 'if (sshdr.asc == 0x10)' test to avoid the second test
(the values tested are different).
Still for the same ILLEGAL REQUEST case, move the declarations of the
From: Damien Le Moal
Re-shuffle the code to be more efficient by not initializing
variables upfront (i.e. do it only when necessary).
Also replace the do_div calls with calls to sectors_to_logical().
No functional change is introduced by this patch.
Signed-off-by: Damien
From: Damien Le Moal
Fix argument names and description of functions documentation comments.
No functional change is introduced by this patch.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd.c | 29 ++---
1 file changed,
From: Damien Le Moal
This series of small patches cleanup code mainly in sd.c and sd_zbc.c, with
another small improvement in scsi_error.c.
Only the last patch of this series introduces a functional change. All other
patches do not change any functionality.
Changes from
From: Damien Le Moal
Use get_unaligned_be32 and get_unaligned_be64 to obtain values from
the sense buffer instead of open coding the operations.
Also change the function return value to a bool and fix the function
signature declaration to remove spaces triggering
From: Bart Van Assche
A value is assigned to the variable 'capacity' in sd_zbc_read_zones()
but that value is never used. Hence remove the variable 'capacity'.
[Damien: There is no need to initialize to 0 the variable 'ret'
in sd_zbc_read_zones()]
Signed-off-by:
From: Damien Le Moal
Rename sd_zbc_setup_write_cmnd() to sd_zbc_write_lock_zone() to be
clear about what the function actually does. To be consistent, also
rename sd_zbc_cancel_write_cmnd() to sd_zbc_write_unlock_zone().
No functional change is introduced by this patch.
From: Damien Le Moal
Re-shuffle the code to be more efficient by not initializing
variables upfront (i.e. do it only when necessary).
Also replace the do_div calls with calls to sectors_to_logical().
No functional change is introduced by this patch.
Signed-off-by: Damien
From: Damien Le Moal
In sd_done(), for the ILLEGAL REQUEST sense key case, add an 'else'
after the first 'if (sshdr.asc == 0x10)' test to avoid the second test
(the values tested are different).
Still for the same ILLEGAL REQUEST case, move the declarations of the
From: Damien Le Moal
Use get_unaligned_be32 and get_unaligned_be64 to obtain values from
the sense buffer instead of open coding the operations.
Also change the function return value to a bool.
No functional change is introduced by this patch.
Signed-off-by: Damien Le
From: Damien Le Moal
Resetting a zone write pointer is equivalent to discarding sectors:
after a reset, the zone sectors will contain zeros (or the format
pattern). So there is no need for mutual exclusion between a zone reset
and write. Similarly to discard, make it the
From: Damien Le Moal
The 'sense_deferred' variable in sd_done() is set only if
'sense_valid' is true. So it is not necessary and the result of
scsi_sense_is_deferred() and of scsi_command_normalize_sense() can
be combined together in 'sense_valid'.
Also, since
From: Damien Le Moal
Use regular format comments documenting functions, fix argument names,
etc
No functional change is introduced by this patch.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd.c | 272
From: Damien Le Moal
This series of small patches cleanup code mainly in sd.c and sd_zbc.c, with
another small improvement in scsi_error.c.
The first 2 patches are not stricktly necessary but would be great to apply to
make emacs pretty printer happy and reduce its
From: Damien Le Moal
No functional change is introduced by this patch.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd.c | 60 +++
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git
21 matches
Mail list logo