Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1339395rwb; Tue, 4 Oct 2022 20:26:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SXcs/1wfBJKu75ASD6VwSjNUP0wPFFanDKDQ88she427HFxL/RMdM0E7uq75e2umVfUFT X-Received: by 2002:a17:907:6d8f:b0:783:a216:61f5 with SMTP id sb15-20020a1709076d8f00b00783a21661f5mr22117829ejc.236.1664940392607; Tue, 04 Oct 2022 20:26:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1664940392; cv=pass; d=google.com; s=arc-20160816; b=lqq5eV8HbF7qgJGBUgMYTZcRGbX9S1NW7mGHHMKlQLFTNvy5Rjy1l0wNXWu9yqNH9u Kpr6zn8aS8/ZiKLlzAag0X6Ho5vgLvx8a4dNIQ9Z+LUs56ekAPra/71zhX6Mt8+e/jO4 jU0xdr8mwIF/htmEwlAQbRQ2B9KC/smwdR+4OJTGR4PLmFLLXk2lMCk2hUcdGc78foNJ NzvCucUJ32xhSs/UtGM3kaGaiMNIV1LVd/3+Nfekc5RvFdDOPQepzWH7WNiefC+OQQqT zRiCtBsogbrrEkBdRyujmay/KA6cBd/ayw3CldYF13dRp0xniKS6k2xhbcrIg9MA/gH8 w2jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lChuMBUbOFhhqwMYG55HB+a43mZAtKoP2WF4KJFYW8s=; b=Z4T5N81BFeefJV4k6bza89LIaQkJESP9u6wSz82JZ7Y7//1JAQSKIBnrEy+E9gm9u4 e9krli7vY0O3M2DnKu+ReC55/ss4L6u3te4if+0vzVhS1G5wLqbS56DSO5WruXDqueS8 KjWwFsvnMmgVn/OaYyh9fRHyWA4DeEb47Vw0+Q+NF/I14vzP8ShEyuBrAE5Qoxy7KSe8 8ND68TTbGRWbQI7yJ+0Aun06FPTlz26okFtfMAbCaSuxBFey5T4EUgxRVjrNDhYe7MPZ 1Frk+Wa3Fq1v7MYCfMZDD1rA2Qaqh2F8b4wlDQ2OWK80VnxcttW0gOv4VpldUexF5mDJ SObg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=pzmTm6Hk; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my7-20020a1709065a4700b0077b2e822b8fsi8274301ejc.76.2022.10.04.20.26.07; Tue, 04 Oct 2022 20:26:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=pzmTm6Hk; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiJEDYS (ORCPT + 99 others); Tue, 4 Oct 2022 23:24:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiJEDYG (ORCPT ); Tue, 4 Oct 2022 23:24:06 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3D9726AC; Tue, 4 Oct 2022 20:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nfhKkEgYv2aiNQEp3POyqtmYhWpzL5WgccX6YklyqA+GYvbaqcRS5cJlmb1QDwHxjSK0eSlZRZg0z7OHzPjtWJCtcLgj6f426N+pOZ4zEHn0GanIyvVCze1r9a+wWrUDrDiRJnh9Exdz5anBxwIuqyej06ZLpygPD115tHnaFYOZzwLSWyQZrGp7QxPc0lB5XNV9BPoiw8uWnMCOVHqZHvXcOnHx0J4JB4q6sZXuzU6DEXc4U9AkDDsHFMYnmh6a049gDhGQjQ7m1inQJNiW8Y54UAAyNTYz9anTLaqJ/p+hDCAr8zil0SujoaVKVF5mqkZX/uZ3Bu0s3kgXJkHsGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lChuMBUbOFhhqwMYG55HB+a43mZAtKoP2WF4KJFYW8s=; b=Q5VtezUk1JL04Mh/1YjitLKI9AgFxoxh1oTm3ks0XThwiZbRWUz7PxT89hq467nPnZqIgEK4GqdvPRSkSDj74NloZTtK5ARJook4dQJ0oaWl3bGdJaa/wMKCgFV+mhht7NuLIyx7a26pKCg7YIrF4fYQ9tU81u0Taa1q33LQnmfPdc8c3UXRJW6YIBRX973bcIzt/I8UReqNKEjH+4+sRoGiopoU19q9an4f+ApZZaUfR4IHbEdaX7719wL9BTOw8z9M3jAkrB0f3Br0bwsiYzp6BoBTyBpQ3LZkjWWc2IdTxBCxjP5TmF0rC9xmkCgbCy5jOmnqK1xXbYRzl6U6cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lChuMBUbOFhhqwMYG55HB+a43mZAtKoP2WF4KJFYW8s=; b=pzmTm6HkOUV3UVgyd5mMJFFUe/2vIyGMlnxER5JeWYVMUFHfe08nEQ4/VT+SCVOuZE73thu+aQhmAwdDVHwLl3BnaqHoejBMaxV88nuisJRQscpTDzyApQEFeqmp2ENnBe/JLeq1PaGUhzZv7u/8taN3F8if/XxI5K9NH2fP9IdYdhoSq4OmHs52xS3A2ZnGr+ZajYaOGW1KgN2lDYkb3cH6dYXc8R9ropyMtLm1cuR8CKEjP3I+GzeuzTNJjU8C9BIbKHFXKjj3srXiJvQV9LUGShaLpaiwVd00n4ASmV/KgVfVZq5jBJvbPM21Sq3u1qledUYx+t/doJEbMsV40Q== Received: from BN9PR03CA0686.namprd03.prod.outlook.com (2603:10b6:408:10e::31) by DM4PR12MB5343.namprd12.prod.outlook.com (2603:10b6:5:389::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Wed, 5 Oct 2022 03:23:46 +0000 Received: from BN8NAM11FT026.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10e:cafe::d) by BN9PR03CA0686.outlook.office365.com (2603:10b6:408:10e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.26 via Frontend Transport; Wed, 5 Oct 2022 03:23:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT026.mail.protection.outlook.com (10.13.177.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.10 via Frontend Transport; Wed, 5 Oct 2022 03:23:46 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 4 Oct 2022 20:23:37 -0700 Received: from dev.nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 4 Oct 2022 20:23:33 -0700 From: Chaitanya Kulkarni To: , , , , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH 02/21] loop: use lib tagset init helper Date: Tue, 4 Oct 2022 20:22:38 -0700 Message-ID: <20221005032257.80681-3-kch@nvidia.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20221005032257.80681-1-kch@nvidia.com> References: <20221005032257.80681-1-kch@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT026:EE_|DM4PR12MB5343:EE_ X-MS-Office365-Filtering-Correlation-Id: 6eb8e058-cf52-44af-d469-08daa681035e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N63D4c9Sqwhwd9gnirIdsjnXbpQpXuN3ZkesPglRqtt8pE3qiTm3uld9PDCR9Qa2Nx/t19Q0WG5hWcZb0r7coevO1VgcYZCJl/DpE6pEIPI1G3BRtSGa6blhImTbwes4m5ftw8+M2V0hQDrIVUBPbfMTyD7JoId9TYWh2GerO3708HILCtSj/911Sft9wvFGqXPtsDk3LZbQzh1Vd1QV6Ip6fd2E2vUl3eqyeWZh6rgM6YNUSZ2+MdeV3LTFqP2QpIEvNqsBHNSOsD8RuP89qwfk2RLdfCEk0BfGVaAAdThtnZYx+sqIDfd5JBaBoQ1SeRd08b/a3swgyg9m3gsJpG0yAnMpVlf+WeJwx59+91f6ZedfAAZVAc2flFfXniu1RlFW0tQoCRln/2+DpAnDn6mz9jVEIVQOrkV+OPhtfPfVm0AyB9cBt5PIw0DxgBCax52UiwSWlpklGwXwPP4nB4Fu5HqbzGJNlbcPJibYrR7bavmtUDxKulAdi/FfELrBKGUHZQnEiSzCNLZULkXmcDzvRRNNqZbRfeVw66Pzvb7mDwTsg/EwJgn2sK0J5gjnu1fdJzbKNAoBoggoYGsSFPwWvAhZ2u+MNzeFdfLuw0pLEedfXyn44nJ5/NqpR747j7yGR8w+256Di7Q3sA4VRm5SYRcJ9JLBT7t8jtUUvvR0eoNocYFiz8d9SBk15nTnD9syCqEfoSliDt+w7H+65aXgKSmcRJNTLE9x+UG2c8Yw4zUAOvjizvTsiCWXZsdf0I4qpXCqQfxiGjo7XTe52Fsd7jg770N6tkJdk1dicZDYPS6HyAli0Le5bPRLfOZfGnKNkqBgOjXAwZi9++9MrRgYKmkEZoeGLf6A6H4eAbI= X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(376002)(39860400002)(346002)(136003)(451199015)(46966006)(36840700001)(40470700004)(41300700001)(478600001)(110136005)(8676002)(54906003)(4326008)(40460700003)(70586007)(70206006)(7406005)(36756003)(47076005)(82740400003)(316002)(7636003)(36860700001)(83380400001)(7416002)(7366002)(7696005)(40480700001)(26005)(8936002)(426003)(5660300002)(336012)(921005)(2906002)(356005)(16526019)(2616005)(186003)(1076003)(82310400005)(21314003)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2022 03:23:46.1697 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6eb8e058-cf52-44af-d469-08daa681035e X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT026.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5343 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the block layer helper to initialize the common fields of tag_set such as blk_mq_ops, number of h/w queues, queue depth, command size, numa_node, timeout, BLK_MQ_F_XXX flags, driver data. This initialization is spread all over the block drivers. This avoids the code repetation of the inialization code of the tag set in current block drivers and any future ones. Signed-off-by: Chaitanya Kulkarni --- drivers/block/loop.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index ad92192c7d61..a915f25b4410 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1937,6 +1937,8 @@ static const struct blk_mq_ops loop_mq_ops = { static int loop_add(int i) { + unsigned int flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING | + BLK_MQ_F_NO_SCHED_BY_DEFAULT; struct loop_device *lo; struct gendisk *disk; int err; @@ -1967,14 +1969,8 @@ static int loop_add(int i) goto out_free_dev; i = err; - lo->tag_set.ops = &loop_mq_ops; - lo->tag_set.nr_hw_queues = 1; - lo->tag_set.queue_depth = hw_queue_depth; - lo->tag_set.numa_node = NUMA_NO_NODE; - lo->tag_set.cmd_size = sizeof(struct loop_cmd); - lo->tag_set.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_STACKING | - BLK_MQ_F_NO_SCHED_BY_DEFAULT; - lo->tag_set.driver_data = lo; + blk_mq_init_tag_set(&lo->tag_set, &loop_mq_ops, 1, hw_queue_depth, + sizeof(struct loop_cmd), NUMA_NO_NODE, 0, flags, lo); err = blk_mq_alloc_tag_set(&lo->tag_set); if (err) -- 2.29.0