From patchwork Thu Dec 28 07:51:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 759803 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 653635244; Thu, 28 Dec 2023 07:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pYVw9iWI" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=OxBUl5R3EwjwockHF3eENF9Jxp82TA96jdI6BZ6Pk2Q=; b=pYVw9iWIwpmXmn6vVt1FtMEov4 b4FXtLsDdTJ/SIWMBXq2Yja+oGm+pFQhsROV42VP5o8oRTS6qzGm3NczSSz7ftjdn1RqnXL4HFzMg b0AQasvUGNNoiy49kTVXTDaaBU++1IM+x6RXLdaEWdW1ZSVzo1IIRl7Hd2klM5KaAsVTLG0d5PQsq +NgbAJoAQR6474A3ucHxFuu8LYgM5KF3pk1C+Mjwbfh80NLn/O+KNQFyEaLsdUtODvzKbpKGxFUoj K/GyuRnITJkfp82dzfg8pTHxaINjhzpftPrt/Nz/vFGtAFqT77vuFwN4IKgNPRlOpfMxjtpsxxuh+ ovcyxggA==; Received: from 213-147-167-209.nat.highway.webapn.at ([213.147.167.209] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rIlBJ-00GMgc-18; Thu, 28 Dec 2023 07:51:54 +0000 From: Christoph Hellwig To: Jens Axboe Cc: "Martin K. Petersen" , Damien Le Moal , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 1/2] sd: remove the !ZBC && blk_queue_is_zoned case in sd_read_block_characteristics Date: Thu, 28 Dec 2023 07:51:40 +0000 Message-Id: <20231228075141.362560-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231228075141.362560-1-hch@lst.de> References: <20231228075141.362560-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Now that host-aware devices are always treated as conventional this case can't happen. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/scsi/sd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 6bedd2d5298f6d..dace4aa8e3534d 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3149,12 +3149,11 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) * the device physical block size. */ blk_queue_zone_write_granularity(q, sdkp->physical_block_size); - } else if (blk_queue_is_zoned(q)) { + } else { /* - * Anything else. This includes host-aware device that we treat - * as conventional. + * Host-aware devices are treated as conventional. */ - disk_clear_zoned(sdkp->disk); + WARN_ON_ONCE(blk_queue_is_zoned(q)); } #endif /* CONFIG_BLK_DEV_ZONED */ From patchwork Thu Dec 28 07:51:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 758773 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 908406131; Thu, 28 Dec 2023 07:52:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="RbOlatFh" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=44RD+jZ6DX4O8SC8COa74HVFOT+lGHCy7Syx/jSjYPc=; b=RbOlatFhVuiRr6iNXXxcTrrVaw ffZjFv7WcGYSquyQygRjai6B6JXCXhgurG5ZKILEiJt+Jab99W2G0CKY2gPh3rW7yNwgZrhJJP5M2 woz6bYRdTEKdb3RKu18vXYYFO0T6WzcD5ocJWjqt++DKphILrC2DYJCY7Tk+hgHvBqaL9xPuoYrWy AUieUJNteSFCpqwNQuayGtoNF1iktSN8Va6/e41qhlxsDV/gHhLteT6SIX/6TPBBC1klN0iVba9+r PlgGx4QFLpPiW28ImXb18GkAdrIXx9JH1XUXm7EhZ9FSCg6aulgTvvwimg/TZKz3qpzWKExOqVqTG NtpRt0dA==; Received: from 213-147-167-209.nat.highway.webapn.at ([213.147.167.209] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rIlBO-00GMhU-0V; Thu, 28 Dec 2023 07:51:59 +0000 From: Christoph Hellwig To: Jens Axboe Cc: "Martin K. Petersen" , Damien Le Moal , linux-block@vger.kernel.org, linux-scsi@vger.kernel.org Subject: [PATCH 2/2] block: remove disk_clear_zoned Date: Thu, 28 Dec 2023 07:51:41 +0000 Message-Id: <20231228075141.362560-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231228075141.362560-1-hch@lst.de> References: <20231228075141.362560-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html disk_clear_zoned is unused now that the last warts of the host-aware model support in sd are gone. Signed-off-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- block/blk-zoned.c | 21 --------------------- include/linux/blkdev.h | 1 - 2 files changed, 22 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index c59d44ee6b236e..623879d875a43f 100644 --- a/block/blk-zoned.c +++ b/block/blk-zoned.c @@ -615,24 +615,3 @@ int blk_revalidate_disk_zones(struct gendisk *disk, return ret; } EXPORT_SYMBOL_GPL(blk_revalidate_disk_zones); - -void disk_clear_zoned(struct gendisk *disk) -{ - struct request_queue *q = disk->queue; - - blk_mq_freeze_queue(q); - - q->limits.zoned = false; - disk_free_zone_bitmaps(disk); - blk_queue_flag_clear(QUEUE_FLAG_ZONE_RESETALL, q); - q->required_elevator_features &= ~ELEVATOR_F_ZBD_SEQ_WRITE; - disk->nr_zones = 0; - disk->max_open_zones = 0; - disk->max_active_zones = 0; - q->limits.chunk_sectors = 0; - q->limits.zone_write_granularity = 0; - q->limits.max_zone_append_sectors = 0; - - blk_mq_unfreeze_queue(q); -} -EXPORT_SYMBOL_GPL(disk_clear_zoned); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9f9fbc22c4b037..de944baddd6036 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -318,7 +318,6 @@ typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx, void *data); void disk_set_zoned(struct gendisk *disk); -void disk_clear_zoned(struct gendisk *disk); #define BLK_ALL_ZONES ((unsigned int)-1) int blkdev_report_zones(struct block_device *bdev, sector_t sector,