From patchwork Mon Jan 22 17:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13525905 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 F2A1B40BE3; Mon, 22 Jan 2024 17:37:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705945024; cv=none; b=ICpRHIqIDRa60NGfr+z8tvLTsSn977nm7NYzpD0HFmJZBDYhwjv8jLX78usTQ89rZck8sW/a2R+dpKYkDjv4m6s8rqb0kgdN86iTVKBYx61uhwivxtmzGArOnJjVqiGXX9APNFtfeMXmB9s6TLi8rw7RzZvziZCpPc4cQktuekk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705945024; c=relaxed/simple; bh=fHROvt5OFKXveRtwm7nS7D7bWwlzshkrfW7uin0qYGo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=paOJ/aUauzxfG2GTIP7yOTmk/7QBmg+6DKSryV0iuOd8TjHOBBRcl2ETtDcowqqAYmxfUKhFueTCO7GQNTwZq7U+ZfaFWvd8RmV2TaNl1SP+8uEybWWFhqyEdxZE2vOZyNylHZRpiVGxIlGqbCkOoEOxXvQKN03rPawca9bg4kY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=DTKAfP2U; arc=none smtp.client-ip=198.137.202.133 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="DTKAfP2U" 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=tkwWaCS229lrm8RVxOlCwAX2BdD4eXBnEUqUwp253oU=; b=DTKAfP2UJmCqETONB0o8+Voaj6 lXjhdhip72xAOqdWK7u3UbwUiI3jwoqt7NgpqHfTCXuzUBGF7Q1f9PZFnR66I8JFrL38MW0WEyZGB gp1HHF/zl/Vnj+p/QPo0L03Fr3gdwCENSyHTDJBjK4GlQo55tj74Gg1pxLtGlKHRBFgFlZINCpak1 VZ0KGNPNpsW2upEb8xWtdTMh+3O4k3x0mffyv/PJT4+RRv53kD5tkH5kOyWikttwH4lE6ZgnSU+/J wuTBGfwwIXYXs6RChRQNlr3IO7CtJJaTFbZyTvSHqUMIwZyvuHxpcXpMd1UMweyjMQ/VxeT5aOrgi KtNh0gag==; Received: from [2001:4bb8:198:a22c:146a:86ef:5806:b115] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rRyE7-00DGbT-18; Mon, 22 Jan 2024 17:36:51 +0000 From: Christoph Hellwig To: Jens Axboe Cc: "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , Paolo Bonzini , Stefan Hajnoczi , "Martin K. Petersen" , Damien Le Moal , Keith Busch , Sagi Grimberg , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, virtualization@lists.linux.dev Subject: [PATCH 01/15] block: move max_{open,active}_zones to struct queue_limits Date: Mon, 22 Jan 2024 18:36:31 +0100 Message-Id: <20240122173645.1686078-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240122173645.1686078-1-hch@lst.de> References: <20240122173645.1686078-1-hch@lst.de> Precedence: bulk X-Mailing-List: linux-block@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 The maximum number of open and active zones is a limit on the queue and should be places there so that we can including it in the upcoming queue limits batch update API. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal Reviewed-by: Hannes Reinecke --- include/linux/blkdev.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 99e4f5e722132c..4a2e82c7971c86 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -189,8 +189,6 @@ struct gendisk { * blk_mq_unfreeze_queue(). */ unsigned int nr_zones; - unsigned int max_open_zones; - unsigned int max_active_zones; unsigned long *conv_zones_bitmap; unsigned long *seq_zones_wlock; #endif /* CONFIG_BLK_DEV_ZONED */ @@ -307,6 +305,8 @@ struct queue_limits { unsigned char discard_misaligned; unsigned char raid_partial_stripes_expensive; bool zoned; + unsigned int max_open_zones; + unsigned int max_active_zones; /* * Drivers that set dma_alignment to less than 511 must be prepared to @@ -639,23 +639,23 @@ static inline bool disk_zone_is_seq(struct gendisk *disk, sector_t sector) static inline void disk_set_max_open_zones(struct gendisk *disk, unsigned int max_open_zones) { - disk->max_open_zones = max_open_zones; + disk->queue->limits.max_open_zones = max_open_zones; } static inline void disk_set_max_active_zones(struct gendisk *disk, unsigned int max_active_zones) { - disk->max_active_zones = max_active_zones; + disk->queue->limits.max_active_zones = max_active_zones; } static inline unsigned int bdev_max_open_zones(struct block_device *bdev) { - return bdev->bd_disk->max_open_zones; + return bdev->bd_disk->queue->limits.max_open_zones; } static inline unsigned int bdev_max_active_zones(struct block_device *bdev) { - return bdev->bd_disk->max_active_zones; + return bdev->bd_disk->queue->limits.max_active_zones; } #else /* CONFIG_BLK_DEV_ZONED */