diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2021-12-01 15:28:30 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-12-03 03:41:47 +0100 |
commit | 13202ebf5f331ca83f5ab47eb90ca4ef5489ac80 (patch) | |
tree | d3bf8886a27c27f50d0d385f4a6ca77ecb2334db /drivers/scsi/sd_zbc.c | |
parent | scsi: Remove superfluous #include <linux/async.h> directives (diff) | |
download | linux-13202ebf5f331ca83f5ab47eb90ca4ef5489ac80.tar.xz linux-13202ebf5f331ca83f5ab47eb90ca4ef5489ac80.zip |
scsi: sd_zbc: Simplify zone full condition check
According to the ZBC (and ZAC) specification, a zone that has Zone Type set
to Conventional, must also have its Zone Condition set to "Not Write
Pointer".
Therefore, a conventional zone will never have Zone Condition set to
"Full", which means that we can omit the non-conventional prerequisite from
the zone full condition check.
Link: https://lore.kernel.org/r/20211201142821.64650-1-Niklas.Cassel@wdc.com
Suggested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/sd_zbc.c')
-rw-r--r-- | drivers/scsi/sd_zbc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index ed06798983f8..749c5e5a70c7 100644 --- a/drivers/scsi/sd_zbc.c +++ b/drivers/scsi/sd_zbc.c @@ -62,8 +62,7 @@ static int sd_zbc_parse_report(struct scsi_disk *sdkp, u8 *buf, zone.capacity = zone.len; zone.start = logical_to_sectors(sdp, get_unaligned_be64(&buf[16])); zone.wp = logical_to_sectors(sdp, get_unaligned_be64(&buf[24])); - if (zone.type != ZBC_ZONE_TYPE_CONV && - zone.cond == ZBC_ZONE_COND_FULL) + if (zone.cond == ZBC_ZONE_COND_FULL) zone.wp = zone.start + zone.len; ret = cb(&zone, idx, data); |