From patchwork Fri Feb 3 15:06:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13127846 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 5673FC6FD1D for ; Fri, 3 Feb 2023 15:07:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 017AA6B007B; Fri, 3 Feb 2023 10:07:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AE5DD6B0072; Fri, 3 Feb 2023 10:07:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 629736B007D; Fri, 3 Feb 2023 10:07:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 3A0396B007E for ; Fri, 3 Feb 2023 10:07:49 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 16964803AE for ; Fri, 3 Feb 2023 15:07:49 +0000 (UTC) X-FDA: 80426310258.11.985D7B2 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf18.hostedemail.com (Postfix) with ESMTP id 4CE271C002A for ; Fri, 3 Feb 2023 15:07:47 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=BeevEGfH; spf=none (imf18.hostedemail.com: domain of BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675436867; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hAZBDljuWATtT7MZb8+aicFX05OEHsXWwcxbzwocn/Y=; b=dV2j+NRzWEqLdB6nRAIq+YFFOnR77+vXoKmswbcJai2kkpuR5yizSacCO/+po2asb700HF f6w6tuIa47ogMFWeyuK3BBcype+t6FwmzFWC0pQreIpLBLQ/lkRP09/mTjRyYAQ6z5+eSW 1eK4+baAso2YbarUU8iZ0/bxta3oKVs= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=BeevEGfH; spf=none (imf18.hostedemail.com: domain of BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+416129e804eec9e75a33+7103+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675436867; a=rsa-sha256; cv=none; b=EGNUEmYo+MUbxTPum1aQBW1BBc+Cm4CnqhDXX1G0W04M87ONURtgebM2yr3BK3C7PWWCLB dN3W8iBKaIkW+b+f3EV9jIWxOWL/hRKKDdXwvn8BolwojP8rwqSTUBSgFX2qeBxOGTEORZ xyJRd0JNaDroFC6IgbvjKED/2Xj9Wss= 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=hAZBDljuWATtT7MZb8+aicFX05OEHsXWwcxbzwocn/Y=; b=BeevEGfHXEz3RQ2pm30ri/lLot 7BknWxcTJCe8bHwiFgaBXD6npSlvAv3IEIcsbkShJ3RfjiaydSSo5L6SFdm8AJ7WoHjFa/htGhWkp 4wGSwgvGKmly4xNp6v5luVv0iyrkXZnWP2/pz7K3wCYJcXHk5hRM2nDzle/Au3h9vm087+yLkb6az 7ehquK3STiJQhULDlHMJ2qG5Ug/GxsArwlHmPwoqzm3C5tnanQyZve2lPxuQhUSgjWjv2GmcjIlnY Visqz9lIqxv7q/UIrUmyPC1LhCL2btyMsdEUNkOGFE9y6nnV9zO5myX06OAAMNCoqqAdLUEkSnYKd aGyQrdEg==; Received: from [2001:4bb8:19a:272a:910:bb67:7287:f956] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNxeV-002am6-95; Fri, 03 Feb 2023 15:06:59 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Ilya Dryomov , "Michael S. Tsirkin" , Jason Wang , Minchan Kim , Sergey Senozhatsky , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" , David Howells , Marc Dionne , Xiubo Li , Steve French , Trond Myklebust , Anna Schumaker , Mike Marshall , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Chuck Lever , linux-block@vger.kernel.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, devel@lists.orangefs.org, io-uring@vger.kernel.org, linux-mm@kvack.org, Johannes Thumshirn Subject: [PATCH 07/23] nvme: use bvec_set_virt to initialize special_vec Date: Fri, 3 Feb 2023 16:06:18 +0100 Message-Id: <20230203150634.3199647-8-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230203150634.3199647-1-hch@lst.de> References: <20230203150634.3199647-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 X-Stat-Signature: ikht8t1mzpw5p8s86pdmgh5fcc1ysst8 X-Rspam-User: X-Rspamd-Queue-Id: 4CE271C002A X-Rspamd-Server: rspam06 X-HE-Tag: 1675436867-390218 X-HE-Meta: U2FsdGVkX18PmWVGg3VpJB1KaqJTiItktkwE+cPcRjJGCEyXuDTm033EnkIji+EHVjLqBJi41btzIjyPBzjjUb4kX03t5Tn2S968ry0HfgKGv7u5HbgZRx8gwYnOR2AMvIcEQOARgETVfuzCjy8zamYEkoCEmeqpcG3s3YDm8Fzm6/tQiacoSADcyHsU20ptECu4/9/kO1ehBZRDsozwkC2TnZt32pw7TPgrOt0Dj/XzbPmYwU5gRciNxHEqR6bKX0Q5UFADswrqOrmP+xrSOoSNfD/gD2R0ucgDXLHNhA1+I5nvIxlIipyKM42zh85qCV/JJx1zQUX/JiX7jvW+8yw9EhsiEaN/0qvSVZ4D43lnxldIFWYOEWs7M0Ds7ilEKtxlcNPQVokmA5f6oifAumkPMmT/y2rDGa7JLM0BghEXeR8HWmC5UVTblthGbwslthbNlQkHNN2in9w/LRuc3t2dZa7vinbmb6MkXo149ee7R+W3BZFNfwIETGFEMGYA12S1LSo/2jy2S5SHB44fdB3eQ0awVvXF12bNYrcv2iDOIfyKqJN7ee32I9WHF5rlbn4Vymtskl/13f/2k1FyrPYrxPbU3FUpGiKMpjTHiTMbngSDHvcmHlfAez1xAxMK93jJdPb6RcRJ9nBp+1UOZZkMzQHK3NKjEV0VBP/9CROCmEesZM6s11vqsBFm9qVG/XB036nkwpA0rwiIR1kh6dlyjUXUJ8Wb8pPdn5m7mrLg0BgVrOZPrmQpMZxKHr1w9LRI28ULNu67yFJw3E3eHaRg1uyJglvGkggvDmBZF5w5WauJsubsNRN7jYy3ENFVH2WsYpM7o537/3xQrPbENAd91IOit3/4jJdjVLRtZEPFz2yYrqPV1qENm1Cd1UnBOjXIaVM8PfCbg6MU0IwCFLWoISVyf+clqy1hzkXFN3at0NBlsIcZNUB4pOrJAZE+/SmFHGBndM2X31sx5AR dpgICBNj RG+v5PbMhdzXGOGsHvqBsauaE7yIa9ZmlcQk/lOeVcsJZcI0+CCprU7rBm+JJx+PJge1Vv2hzdU4ABfR2xhmBF6gIzUCBitRw80NSlKYz45UiWZ+8BDQbFE97ntlT2ycBmXJfIPjn/L9tRyRlEVtES3jw9YVbhKnij0YtnHGcslnyUzVWL3QZOYsPJxXqv7prG2W5zWhvifDGY/94oCQcFf/lX6p/PzU927D4hSFa1QNe5YeYqUA0xdh3KS+AOHLZE3sHa1o97/3lr5ij+3A4geVU6EMIcP4EAUm1ix8V+CbfZCvZVCSdUp4+/NFtguFtA/iu5O1eUZdVwbWkh/kuDPj6ESJE5ecO2zeQR/31lMnMJ2CcO6q+jyoWUtcLCsxuzMaA/fBi9h95J3m/amZWlGN993RRz1FDHbb+yA/GJ33oxlPw8DyhXFPt32ts1N3MWj36rpsj5/HBl3scvY3/oc8QYS2SLA7v4rl4HvhmzBx4+0s2ZCzzPwwYdIZddkJB7NzK0BC17uVLV7Dsc5AN6l1z9mvGFetteP9uxMBzfkkMQL9OmcQ6ndHF0Q== 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: Use the bvec_set_virt helper to initialize the special_vec. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 505e16f20e57fa..7ba1accc3c22a4 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -806,9 +806,7 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req, cmnd->dsm.nr = cpu_to_le32(segments - 1); cmnd->dsm.attributes = cpu_to_le32(NVME_DSMGMT_AD); - req->special_vec.bv_page = virt_to_page(range); - req->special_vec.bv_offset = offset_in_page(range); - req->special_vec.bv_len = alloc_size; + bvec_set_virt(&req->special_vec, range, alloc_size); req->rq_flags |= RQF_SPECIAL_PAYLOAD; return BLK_STS_OK;