[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/26] sd: move zone limits setup out of sd_read_block_characteristics
 
- To: Christoph Hellwig <hch@xxxxxx>, Jens Axboe <axboe@xxxxxxxxx>
 
- From: Hannes Reinecke <hare@xxxxxxx>
 
- Date: Tue, 11 Jun 2024 10:12:13 +0200
 
- Authentication-results: smtp-out1.suse.de;	none
 
- Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Richard Weinberger <richard@xxxxxx>, Philipp Reisner <philipp.reisner@xxxxxxxxxx>, Lars Ellenberg <lars.ellenberg@xxxxxxxxxx>, Christoph Böhmwalder <christoph.boehmwalder@xxxxxxxxxx>, Josef Bacik <josef@xxxxxxxxxxxxxx>, Ming Lei <ming.lei@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Alasdair Kergon <agk@xxxxxxxxxx>, Mike Snitzer <snitzer@xxxxxxxxxx>, Mikulas Patocka <mpatocka@xxxxxxxxxx>, Song Liu <song@xxxxxxxxxx>, Yu Kuai <yukuai3@xxxxxxxxxx>, Vineeth Vijayan <vneethv@xxxxxxxxxxxxx>, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, linux-m68k@xxxxxxxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxxx, nbd@xxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-bcache@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxxxxxxx, linux-raid@xxxxxxxxxxxxxxx, linux-mmc@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, nvdimm@xxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx
 
- Delivery-date: Tue, 11 Jun 2024 08:12:20 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
On 6/11/24 07:19, Christoph Hellwig wrote:
 
Move a bit of code that sets up the zone flag and the write granularity
into sd_zbc_read_zones to be with the rest of the zoned limits.
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
  drivers/scsi/sd.c     | 21 +--------------------
  drivers/scsi/sd_zbc.c | 13 ++++++++++++-
  2 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 85b45345a27739..5bfed61c70db8f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3308,29 +3308,10 @@ static void sd_read_block_characteristics(struct 
scsi_disk *sdkp,
                blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
        }
  
-
-#ifdef CONFIG_BLK_DEV_ZONED /* sd_probe rejects ZBD devices early otherwise */
-       if (sdkp->device->type == TYPE_ZBC) {
-               lim->zoned = true;
-
-               /*
-                * Per ZBC and ZAC specifications, writes in sequential write
-                * required zones of host-managed devices must be aligned to
-                * the device physical block size.
-                */
-               lim->zone_write_granularity = sdkp->physical_block_size;
-       } else {
-               /*
-                * Host-aware devices are treated as conventional.
-                */
-               lim->zoned = false;
-       }
-#endif /* CONFIG_BLK_DEV_ZONED */
-
        if (!sdkp->first_scan)
                return;
  
-	if (lim->zoned)
+       if (sdkp->device->type == TYPE_ZBC)
 
 
Why not sd_is_zoned()?
Cheers,
Hannes
--
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@xxxxxxx                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
 
 
    
     |