From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4EFEC63797 for ; Tue, 17 Jan 2023 08:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236050AbjAQIN2 (ORCPT ); Tue, 17 Jan 2023 03:13:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236040AbjAQINW (ORCPT ); Tue, 17 Jan 2023 03:13:22 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34AFC2196A; Tue, 17 Jan 2023 00:13:21 -0800 (PST) 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=M14grjLMYCiI1fyql6U5DXfzrN2Vd5HBIdsYVLgwjjE=; b=qPfLPqGwZY3TNDf6jXNSA23jJT DRqwTwYQBe83r1GOLlzI8Bb1quLI9aeg5k4avSLhWctgRnt4SzjTYq7+xl9fhJapFfyzweIm+rOKS ItgK4tzV65E+JCo/xwHxokoqveFxuz52wn99h3uW3S8z9i5usLg8EIZSP7i5cycF0ppievCZlhwD/ iaE9hl7ffhE7tWFNleMT5oo59/PrDcZBXPTI9mmQtr4hK3zW0rLb2mHpWRlVgPjRm4gbYbpbyzhzG rglUMZKpf+AHf0Z8fm5CVqGrs1kdC4k33Lrt97V7si7TGbnGPcpTlwazLgHDqCgPEFGrgtBmhaPIn g7xGfUQg==; Received: from [2001:4bb8:19a:2039:eaa2:3b9e:be2e:bd2a] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHh5r-00DHk1-01; Tue, 17 Jan 2023 08:13:19 +0000 From: Christoph Hellwig To: Jens Axboe , Tejun Heo , Josef Bacik Cc: linux-block@vger.kernel.org, cgroups@vger.kernel.org Subject: [PATCH 07/15] blk-wbt: pass a gendisk to wbt_init Date: Tue, 17 Jan 2023 09:12:49 +0100 Message-Id: <20230117081257.3089859-8-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230117081257.3089859-1-hch@lst.de> References: <20230117081257.3089859-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Pass a gendisk to wbt_init to prepare for phasing out usage of the request_queue in the blk-cgroup code. Signed-off-by: Christoph Hellwig --- block/blk-sysfs.c | 2 +- block/blk-wbt.c | 5 +++-- block/blk-wbt.h | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 2074103865f45b..c2adf640e5c816 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -500,7 +500,7 @@ static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page, rqos = wbt_rq_qos(q); if (!rqos) { - ret = wbt_init(q); + ret = wbt_init(q->disk); if (ret) return ret; } diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 8f9302134339c5..542271fa99e8f7 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -671,7 +671,7 @@ void wbt_enable_default(struct gendisk *disk) return; if (queue_is_mq(q) && !disable_flag) - wbt_init(q); + wbt_init(disk); } EXPORT_SYMBOL_GPL(wbt_enable_default); @@ -835,8 +835,9 @@ static struct rq_qos_ops wbt_rqos_ops = { #endif }; -int wbt_init(struct request_queue *q) +int wbt_init(struct gendisk *disk) { + struct request_queue *q = disk->queue; struct rq_wb *rwb; int i; int ret; diff --git a/block/blk-wbt.h b/block/blk-wbt.h index 7ab1cba55c25f7..b673da41a867d3 100644 --- a/block/blk-wbt.h +++ b/block/blk-wbt.h @@ -90,7 +90,7 @@ static inline unsigned int wbt_inflight(struct rq_wb *rwb) #ifdef CONFIG_BLK_WBT -int wbt_init(struct request_queue *); +int wbt_init(struct gendisk *disk); void wbt_disable_default(struct gendisk *disk); void wbt_enable_default(struct gendisk *disk); @@ -104,7 +104,7 @@ u64 wbt_default_latency_nsec(struct request_queue *); #else -static inline int wbt_init(struct request_queue *q) +static inline int wbt_init(struct gendisk *disk) { return -EINVAL; } -- 2.39.0