From patchwork Mon Aug 9 14:17:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12426663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55287C4338F for ; Mon, 9 Aug 2021 14:21:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9E5AC60F93 for ; Mon, 9 Aug 2021 14:21:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9E5AC60F93 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 196626B007E; Mon, 9 Aug 2021 10:21:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F8866B0080; Mon, 9 Aug 2021 10:21:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDB316B0081; Mon, 9 Aug 2021 10:21:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id D17176B007E for ; Mon, 9 Aug 2021 10:21:41 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6FAAB181EE432 for ; Mon, 9 Aug 2021 14:21:41 +0000 (UTC) X-FDA: 78455755602.35.D88396D Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf03.hostedemail.com (Postfix) with ESMTP id 4F2E530000A5 for ; Mon, 9 Aug 2021 14:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=XU6ud6GFQfd/gs3ssOGWEAi2zJPaSrUQBYHYU+p+0Vs=; b=gY8TLua/+YBr0U0KXj8dTN2emm Vw9fqV/WUIYfS0rIBwQ26vKkcEXtAV8qJ5pmxrfp5OIhVw9lMuk2w1G01J4F3H27FusOakvMWFa4F O2Lrg//IqS/IbdJdY2vFHeCsPOTukFvSgB/SpztcvKDHTed8ZAJkZ8mMVikeQ1zW0yd5fYx7qx9N3 Nb4EviWcZ4K4Mr7/s5cSlxXC91CYuscyXCb++mzWzXUPReRDHIHtvWihYw0icKUTxiBjepHalsP95 iB7sF5CexQRBeECPSWLeBnINpRtXyX5/tuEsod50hTKPjsl/Tar7ef2ujYyxA7efcTK8v3L1QcKqc X3apWGFA==; Received: from [2001:4bb8:184:6215:d19a:ace4:57f0:d5ad] (helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mD685-00B4AA-Ao; Mon, 09 Aug 2021 14:20:09 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Tejun Heo , Jan Kara , linux-block@vger.kernel.org, Andrew Morton , cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/5] block: add a queue_has_disk helper Date: Mon, 9 Aug 2021 16:17:42 +0200 Message-Id: <20210809141744.1203023-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210809141744.1203023-1-hch@lst.de> References: <20210809141744.1203023-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b="gY8TLua/"; dmarc=none; spf=none (imf03.hostedemail.com: domain of BATV@casper.srs.infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=BATV@casper.srs.infradead.org X-Stat-Signature: 8htcmb6aej9tawio3ju4cnrnwqbb4ygd X-Rspamd-Queue-Id: 4F2E530000A5 X-Rspamd-Server: rspam01 X-HE-Tag: 1628518900-886011 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: Add a helper to check if a gendisk is associated with a request_queue. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Reviewed-by: Jan Kara --- include/linux/blkdev.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ac3642c88a4d..96f3d9617cd8 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -664,6 +664,7 @@ extern void blk_clear_pm_only(struct request_queue *q); dma_map_page_attrs(dev, (bv)->bv_page, (bv)->bv_offset, (bv)->bv_len, \ (dir), (attrs)) +#define queue_has_disk(q) ((q)->kobj.parent != NULL) #define queue_to_disk(q) (dev_to_disk(kobj_to_dev((q)->kobj.parent))) static inline bool queue_is_mq(struct request_queue *q)