From patchwork Wed Apr 20 04:27:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12819740 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D3C3C433FE for ; Wed, 20 Apr 2022 04:28:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BF27D6B008A; Wed, 20 Apr 2022 00:28:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B7B566B008C; Wed, 20 Apr 2022 00:28:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1C7B6B0092; Wed, 20 Apr 2022 00:28:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0064.hostedemail.com [216.40.44.64]) by kanga.kvack.org (Postfix) with ESMTP id 8E4666B008A for ; Wed, 20 Apr 2022 00:28:09 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 3FDD9A45D4 for ; Wed, 20 Apr 2022 04:28:09 +0000 (UTC) X-FDA: 79375975098.30.A6F338A Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id B0B6B180015 for ; Wed, 20 Apr 2022 04:28:07 +0000 (UTC) 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=EB24Pl6Dnuz4BZ6riMjfOVkZhFkJeCm3U5wG0haI3CE=; b=jPduuzobKlAP+uSSo+Orh9sslf gLWxMlEGJLet2t+xSNTBmZlUIaHZMBkInqspZD4XTswr0i8Oq74biZ6WisQJAMgRFIm8loWVZSIir 0skh3C9AUWNqpAN28r5fJQ6gs2URKw+KVlXZGN61Rnja9IUxv7mvtwCwcwJm/Sk79GQWvT7Lwca17 7Fyre5mcE0nBSwV70cZejcTxkjpRAIuZFJO+Nnn0OUvMOSoLoQlwNO0XT3rQmbaIWq9Tk2czVum1q xXqvK6Ca4IN2RMHS9nbDQJONquzAi7gaJzXzbvtJIMXwGBZGO5yA9Qo4S+u9Nlna6P3Vm3wfISRfk IL3CUhIQ==; Received: from 089144220023.atnat0029.highway.webapn.at ([89.144.220.23] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nh1wi-007FaW-7D; Wed, 20 Apr 2022 04:28:04 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Paolo Valente , Tejun Heo , James Smart , Dick Kennedy , linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-nvme@lists.infradead.org, linux-mm@kvack.org Subject: [PATCH 12/15] blk-cgroup: move blkcg_css to blk-cgroup.c Date: Wed, 20 Apr 2022 06:27:20 +0200 Message-Id: <20220420042723.1010598-13-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220420042723.1010598-1-hch@lst.de> References: <20220420042723.1010598-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=jPduuzob; dmarc=none; spf=none (imf16.hostedemail.com: domain of BATV+4b42fcde86a6810335df+6814+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+4b42fcde86a6810335df+6814+infradead.org+hch@bombadil.srs.infradead.org X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: B0B6B180015 X-Stat-Signature: m3kp8734uefw9mdogkj9ychmekfwz4fr X-HE-Tag: 1650428887-344074 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: blkcg_css is only used in blk-cgroup.c, so move it there. Signed-off-by: Christoph Hellwig --- block/blk-cgroup.c | 17 +++++++++++++++++ block/blk-cgroup.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 8e32cc494808d..8da00ddc1766e 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -59,6 +59,23 @@ static struct workqueue_struct *blkcg_punt_bio_wq; #define BLKG_DESTROY_BATCH_SIZE 64 +/** + * blkcg_css - find the current css + * + * Find the css associated with either the kthread or the current task. + * This may return a dying css, so it is up to the caller to use tryget logic + * to confirm it is alive and well. + */ +static struct cgroup_subsys_state *blkcg_css(void) +{ + struct cgroup_subsys_state *css; + + css = kthread_blkcg(); + if (css) + return css; + return task_css(current, io_cgrp_id); +} + static bool blkcg_policy_enabled(struct request_queue *q, const struct blkcg_policy *pol) { diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 62ed8ed50b6e3..bb670e53a1de2 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h @@ -210,23 +210,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol, char *input, struct blkg_conf_ctx *ctx); void blkg_conf_finish(struct blkg_conf_ctx *ctx); -/** - * blkcg_css - find the current css - * - * Find the css associated with either the kthread or the current task. - * This may return a dying css, so it is up to the caller to use tryget logic - * to confirm it is alive and well. - */ -static inline struct cgroup_subsys_state *blkcg_css(void) -{ - struct cgroup_subsys_state *css; - - css = kthread_blkcg(); - if (css) - return css; - return task_css(current, io_cgrp_id); -} - /** * bio_issue_as_root_blkg - see if this bio needs to be issued as root blkg * @return: true if this bio needs to be submitted with the root blkg context.