From patchwork Mon Jan 30 09:21:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120641 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 0F9B7C54EAA for ; Mon, 30 Jan 2023 09:24:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91C556B0092; Mon, 30 Jan 2023 04:24:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A3206B008C; Mon, 30 Jan 2023 04:24:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 742A06B008A; Mon, 30 Jan 2023 04:24:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 65E476B0088 for ; Mon, 30 Jan 2023 04:24:45 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 404B51C5097 for ; Mon, 30 Jan 2023 09:24:45 +0000 (UTC) X-FDA: 80410930530.19.DC121CD Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf04.hostedemail.com (Postfix) with ESMTP id 90A304001B for ; Mon, 30 Jan 2023 09:24:43 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=vkfX3Qmx; spf=temperror (imf04.hostedemail.com: error in processing during lookup of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org: DNS error) smtp.mailfrom=BATV+3ca177389f0c7d0d5156+7099+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=1675070683; 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=H8iGXniDuXNIMcEmftwucE48paWcF0Q5NpfWk1xxHIY=; b=7conUaMDe4uFGDB783c7J+SKUdlTogghzKH//3iyiplvlJ3tA8JUbQPANAV8nq26ADKJuL BcAqgF4MYwfeWg46t8u7u5eWWFJcw8xeFC0WE+nUtwi7j3VLA6a4hME8LxiTDa5nS8VimF 8CHkHC24vcydch9rejw/Yne0n14FOcw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=vkfX3Qmx; spf=temperror (imf04.hostedemail.com: error in processing during lookup of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org: DNS error) smtp.mailfrom=BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675070683; a=rsa-sha256; cv=none; b=gfg35gH1hhHmOmS1JsLBWL4dp0RE5UD22wVViI+wgNCi9KbNBz96Yf/K9joN9MmuQBrdgs mpsz5FmVWVAMHSwcAAlU2n2XJ7OPcXNLwQvpRLEtBrZksoXLhkity29oJ8tJ8dbZjO6p4k BL1DhPFKdnBXPnr3pjfxa8V++TvXt9Q= 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=H8iGXniDuXNIMcEmftwucE48paWcF0Q5NpfWk1xxHIY=; b=vkfX3QmxaSI2iuDWWBVAgfs1Zx WJgWRBZS7ip4JAwCZLPFbMDGoA3ScG/xVr/qTFJBprf38vBJubWVSkw8js6gVYVnfwnFL+8PuIkb/ 3yIl/CnpBrFD4S/rUHc+8WzsJa3K7jDwAxYnX4tDOoXxTKGOmk355NCt78K71n7tEwRPNCtLZAVlN H0LUQyAGSYaSYwAAVj2vSxCeHizSWaCYlNT46D2TwkYR/HUhHibiarLafpbjqha+BpY01EKupxqcY kdkPUzsSd0uCI3yzdLhyQyxBNhLUCkR2LeXlbT+l1gjTCxSMzBomsRY67f1NNwpM3QsXMl7elLsVM i0BMP0YA==; Received: from [2001:4bb8:19a:272a:732e:e417:47d7:2f4a] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pMQNW-002oKh-HS; Mon, 30 Jan 2023 09:23:07 +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 Subject: [PATCH 18/23] io_uring: use bvec_set_page to initialize a bvec Date: Mon, 30 Jan 2023 10:21:52 +0100 Message-Id: <20230130092157.1759539-19-hch@lst.de> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130092157.1759539-1-hch@lst.de> References: <20230130092157.1759539-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-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 90A304001B X-Stat-Signature: rm473dyqf6q77q38jkzg8rue7uwdh5xf X-Rspam-User: X-HE-Tag: 1675070683-116409 X-HE-Meta: U2FsdGVkX19KTEkE+WJpZnkFKbx7bT6H9su0NHCpJFClA77pGcqm/xwsI9mysZnMk0aWJLn+9UhVEp0Z+pIEzJ8zGHpicbvLPzZNkLYcemnX3HfIOdlUB7fYjtMrqtqrZeD9K0D5A8qYHelTNBxfj84dbXDIsUojTezLifDcOB5uUkpG1gNgyxTbz2qVetm/FuGnJJbhfuOOMTuDnbBrC3eyMPR2C9Us2UwX96bhC0454Eei/M3WgwPp/Z5GRCysliJnlvm7FwS4MuJXNr+A5qt4lDJAkENeBxZlDEpa2DzrOFesBD+4bApgMxyOI2N0Z+T/vhd344nQK3C3qFEpOUrs/jwzsvc38CSJTZ381XsUOU1+riOgfSRT3+eGaF9hCAo6ZOT3o+F/3q2KygoDDls4S1+fcwTSTtd+YymPbQdYRZYT4c3qc7B0blM1caKN1Rd9H6uhm1bQURoCbllieclIyggJnUBtfvFgIMTrv4nS7/xpMkn1kGtMnqhEGMdEgMfTDegQdLuoaJ+b5z0Ds/NYpt4l+I4f9Zz1f+lhmsASweBzMnABwjaDeUuGztbEnod30NPWpOmPV1KgtjEoBmDbb9QafkOWrwkVYYgGi6YETqwiV2x6N3p+JYrRbukBZmIkPThkggXVpd2tc29EFc8nPmKvsE70ZBe4lpUqrQMMfBIFMFk8TC0xdVGaWNxAmfLKdfrdkpP+1cQdx3VM7Y/VO4XTo7xBKbwxsu5mkrDvtwvg4F2253lnkyhiGJeha5T62Ir8oWMiz11+UBrsIjDowp82RrJLiNp8oGw0OBd0GYc+QE5G1yBmc08OKP0AVtFkVONLumXyw6khxwPAqF+uIzQCRj63NU4Iy2Hg7o/pQ0xKxhJznJBeTIPu1WM9XbedD9tMw8FXX3K73q5N4w+iAIRVcLxm9z5kIasfZlC8f4yzC6L+qqge8/Q8NUTWmhqZh1nW+a1W8zKXbv6 kfrEWccV Wck2KjvKz6PYXJEeV+6GFQUFRIt4hxeyB/S4jSIbvJlLWkFCq5mQ/+WfpsZn4oXUxtKl4Btfu8bhbre3Mgo+y5bpVMkFPwvba2GmfMyn5per8Smwfk+7CsmhDr7L1s4SRDRPL8znDyEt2HIANOi+KZNLR3KTQCcdY/oewuS0pSAse1dT+tLPFbTHFZG3wTHccc9Y1SZIrgDaPYim4N8tGGk5qOfn4SDxwdRK1E7ZOsFYRdFq2+s/13S13J8r1vLnfX4FfeW7K76La1kAii2HOCyeI9Y2JA99hrgnu0VR32pvAubgLmUu3QXxtu5Zatuyhp2158dXa561yhcLQKYbBjfC6PMs/ikFbtV7uCjU1a7p3fkyNRGwAgFdeNgC7FcnmZiTIZpSUw0rL6mMhCMiyD610ufOp+WHQZ4Z1ca9QBWzgzaEWwqOkEGLffa2+V9kA4pLDFrLMx9vteMlrcM676bwQ3L9nOFk5Da6wAzH1i5RLPcs= 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_page helper to initialize a bvec. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni --- io_uring/rsrc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 18de10c68a151b..a59fc02de5983c 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -1237,9 +1237,7 @@ static int io_sqe_buffer_register(struct io_ring_ctx *ctx, struct iovec *iov, size_t vec_len; vec_len = min_t(size_t, size, PAGE_SIZE - off); - imu->bvec[i].bv_page = pages[i]; - imu->bvec[i].bv_len = vec_len; - imu->bvec[i].bv_offset = off; + bvec_set_page(&imu->bvec[i], pages[i], vec_len, off); off = 0; size -= vec_len; }