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 X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 EB372C4320A for ; Mon, 9 Aug 2021 14:21:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D1A3E60243 for ; Mon, 9 Aug 2021 14:21:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235009AbhHIOVZ (ORCPT ); Mon, 9 Aug 2021 10:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234986AbhHIOVZ (ORCPT ); Mon, 9 Aug 2021 10:21:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90D82C061796; Mon, 9 Aug 2021 07:21:04 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Add a helper to check if a gendisk is associated with a request_queue. Signed-off-by: Christoph Hellwig --- 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) -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig 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> References: <20210809141744.1203023-1-hch@lst.de> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Return-path: 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==; In-Reply-To: <20210809141744.1203023-1-hch-jcswGhMUV9g@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" To: Jens Axboe Cc: Tejun Heo , Jan Kara , linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrew Morton , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org Add a helper to check if a gendisk is associated with a request_queue. Signed-off-by: Christoph Hellwig --- 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) -- 2.30.2