Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7019252rwr; Wed, 10 May 2023 02:41:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4vV9j/BflNXxRxtLCDC4N7pdpNGLGRlT0+T9xVzufYfqgUqRQIHtb355YEMCAJn7tMyMDC X-Received: by 2002:a05:6a00:a23:b0:63d:45f3:9fc with SMTP id p35-20020a056a000a2300b0063d45f309fcmr20521124pfh.5.1683711689288; Wed, 10 May 2023 02:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683711689; cv=none; d=google.com; s=arc-20160816; b=Mvmek2spg3VIC/UaVLQNiBCr7+yWObCsSqPXJGUl3d/tx906L60kpBt1RnretU2KkF ueHWheY+zkGF4VuWsSl41dZRBcRETduPZg171GRwzk1snBYU3yDaKOr52WPZ/v72ZqOa A7PJXsoWm2Lk4p4ELbEOhwqQ7kZQ6prINOZGoTX0nUuRNV4709fDdGK6OQ0ocX0w3YxL 1hBLChFdVmgfnEVukUQ74/jKkzT7CQL0bvhq7c6Cj2Yuz4/kgwzaDBg0ITAXzbFoW88Q Ry0ZwLtHduFtFCct0wp94/+yIv7XnXTJ2FhCQWuuokFXMybkmzWBpIpItyWAnRYJa2tx UQ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type :content-transfer-encoding:date:message-id:in-reply-to:to:from :sender:reply-to:subject:mime-version:dkim-signature:dkim-filter; bh=dsClYh4QK7KsYkk+2+MP7q9EBU8OpMqvWeVl/PtqLS8=; b=fcqP139vDElHeNtkDXgfWG7Hn97hpdrD+Y/FZhhwdZZESjhWB8ihg0kYSn6BMOjXel +qNv/YlAI5H+fOeIQwRa3ZeliNzOWtdvKVa7HPbsQI+8aKz4u9YLsxtSYoAGqtsvyQ6T gOXb2ABlTevq9K8apfPLurt/AwycMfHkQ+r8b9xYWD0wRLjJPX6EiB92LSZ31JsAvgvm +g7d375qSS9FnNsHDJaLnKPPs9g1SqungF0Xu/yugusWxcb//81G5AQmg6RTGlBG8J0E acRbMIft+abmz2FCiD3Rm0+VIUxOLLguCPvWMaIFfruyeCc/X9ISboUkZMPyKvVi08uM 2pJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=nHbZ8YUC; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e63-20020a636942000000b0052132a8e4e3si3324718pgc.510.2023.05.10.02.41.17; Wed, 10 May 2023 02:41:29 -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=@samsung.com header.s=mail20170921 header.b=nHbZ8YUC; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236422AbjEJIy3 (ORCPT + 99 others); Wed, 10 May 2023 04:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236763AbjEJIyX (ORCPT ); Wed, 10 May 2023 04:54:23 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31FD27DA3 for ; Wed, 10 May 2023 01:54:03 -0700 (PDT) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20230510085401epoutp012e387331bfb2f345a3a5ff9d9e133a68~dvEVTP7_w1497914979epoutp01v for ; Wed, 10 May 2023 08:54:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20230510085401epoutp012e387331bfb2f345a3a5ff9d9e133a68~dvEVTP7_w1497914979epoutp01v DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1683708841; bh=dsClYh4QK7KsYkk+2+MP7q9EBU8OpMqvWeVl/PtqLS8=; h=Subject:Reply-To:From:To:In-Reply-To:Date:References:From; b=nHbZ8YUCOc/bj9xs1OdEEqEwoUOBBGETC9B4hiFEBrQaYD2POIkx8oSOv0LGdH720 D9yLZhAMIMeMsxU6rbK+iDDdxUlYT1fgoHUrcing7B3L4Nr/zKAZDSe7J7c5k7RqWL a7Jfpe5ikASZ704ubrw7HJr0iK6anb69/iq8g/n8= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20230510085401epcas2p1ee8ea140a9d25a916316bc676335698a~dvEUuwE-00054500545epcas2p1e; Wed, 10 May 2023 08:54:01 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.69]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4QGTN82Gbyz4x9Q7; Wed, 10 May 2023 08:54:00 +0000 (GMT) X-AuditID: b6c32a46-8b7ff7000001438d-bf-645b5ba85d8f Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 5F.06.17293.8AB5B546; Wed, 10 May 2023 17:54:00 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH v2 07/14] block: add helper function to get the number of integrity segments Reply-To: j-young.choi@samsung.com Sender: Jinyoung CHOI From: Jinyoung CHOI To: Jinyoung CHOI , "axboe@kernel.dk" , "kbusch@kernel.org" , "hch@lst.de" , "sagi@grimberg.me" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "johannes.thumshirn@wdc.com" , "kch@nvidia.com" , "willy@infradead.org" , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20230510084407epcms2p123f17696d3c30c749897eeaf2c4de684@epcms2p1> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20230510085359epcms2p5a8e36cf9c7147054e024669f5811c782@epcms2p5> Date: Wed, 10 May 2023 17:53:59 +0900 X-CMS-MailID: 20230510085359epcms2p5a8e36cf9c7147054e024669f5811c782 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P X-CPGSPASS: Y X-CPGSPASS: Y X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFJsWRmVeSWpSXmKPExsWy7bCmue6K6OgUg69b+C1W3+1ns3h5SNNi 5eqjTBa9/VvZLBbd2MZk8bfrHpPFpEPXGC2eXp3FZLH3lrbF5V1z2CyWH//HZLHu9XsWi98/ 5rA58Hqcv7eRxWPzCi2Py2dLPTat6mTzmLDoAKPH7psNbB69ze/YPD4+vcXi0bdlFaPH501y Hu0HupkCuKOybTJSE1NSixRS85LzUzLz0m2VvIPjneNNzQwMdQ0tLcyVFPISc1NtlVx8AnTd MnOAzldSKEvMKQUKBSQWFyvp29kU5ZeWpCpk5BeX2CqlFqTkFJgX6BUn5haX5qXr5aWWWBka GBiZAhUmZGdMfnOJseA9V8WU67+YGxi7OLsYOTkkBEwkbn74xtbFyMUhJLCDUaJh/hQgh4OD V0BQ4u8OYZAaYYE4iQuH9rOD2EICShLn1sxiBCkRFjCQuNVrDhJmE9CT+LlkBtgYEYGdLBLf 7x9lhJjPKzGj/SkLhC0tsX35VrBeTgE/idbHlhBhDYkfy3qZIWxRiZur37LD2O+PzYcaIyLR eu8sVI2gxIOfu6HikhKHDn0Fu1hCIF9iw4FAiHCNxNvlB6BK9CWudWwEu4BXwFei7+ZDJhCb RUBV4vjna1A1LhJtr56B1TALyEtsfzuHGWQks4CmxPpd+hDTlSWO3IKq4JPoOPyXHea/ho2/ sbJ3zHvCBNGqJrGoyQgiLCPx9fB89gmMSrMQgTwLydpZCGsXMDKvYhRLLSjOTU8tNiowgsdr cn7uJkZwItZy28E45e0HvUOMTByMhxglOJiVRHi9Q6NShHhTEiurUovy44tKc1KLDzGaAj08 kVlKNDkfmAvySuINTSwNTMzMDM2NTA3MlcR5pW1PJgsJpCeWpGanphakFsH0MXFwSjUwHRPL 5A3I/SbLVRyifqNm4q37t3ZNybn2r7r/47euVL3VXbdV5L8Z23VMXO1TO7sryUti47raIKMr qbrlX7a4nnl5Z++Ekwmzri/q+HRTtK1LVOl5rJXzup1P4tRfbIzq/FlTHGm0+nPHr/AH2e9f azHOvBlndmV7mHWRk65L4Iuljqomiz3iFRhZK+JnZXK5l7JNfLFlVmL+zN4jSQtXsB/PrNl/ yd/kafvku9XJP1/fnum9QWCfb9iMj52LY/OTMnZbhugqeR65f0nE5+K04EdZB6bKXVZoXDT9 w9HLm488vtzq2Pxu3/4L4g7V79u3eAg7yZyV0p7AkHLmu81Mji9dbq8j6tcrt/3h3LCiVYml OCPRUIu5qDgRADTtrYRNBAAA DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20230510084407epcms2p123f17696d3c30c749897eeaf2c4de684 References: <20230510084407epcms2p123f17696d3c30c749897eeaf2c4de684@epcms2p1> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Since request always has the number of integrity segments in the process of generating and merging, a function for simply obtained this has been added. Cc: Christoph Hellwig Cc: Martin K. Petersen Signed-off-by: Jinyoung Choi --- include/linux/blk-integrity.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/blk-integrity.h b/include/linux/blk-integrity.h index 378b2459efe2..45b9fde1fee1 100644 --- a/include/linux/blk-integrity.h +++ b/include/linux/blk-integrity.h @@ -43,6 +43,11 @@ int blk_rq_map_integrity_sg(struct request_queue *, struct bio *, struct scatterlist *); int blk_rq_count_integrity_sg(struct request_queue *, struct bio *); +static inline unsigned short blk_rq_nr_integrity_segments(struct request *rq) +{ + return rq->nr_integrity_segments; +} + static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk) { struct blk_integrity *bi = &disk->queue->integrity; @@ -120,6 +125,10 @@ static inline int blk_rq_count_integrity_sg(struct request_queue *q, { return 0; } +static inline unsigned short blk_rq_nr_integrity_segments(struct request *rq) +{ + return 0; +} static inline int blk_rq_map_integrity_sg(struct request_queue *q, struct bio *b, struct scatterlist *s) -- 2.34.1