Message ID | 20230203150634.3199647-23-hch@lst.de (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1438CC636D4 for <linux-mm@archiver.kernel.org>; Fri, 3 Feb 2023 15:08:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 725396B0095; Fri, 3 Feb 2023 10:08:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 58EC76B0099; Fri, 3 Feb 2023 10:08:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A86E6B0098; Fri, 3 Feb 2023 10:08:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id EC1236B0071 for <linux-mm@kvack.org>; Fri, 3 Feb 2023 10:08:48 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id ACA1916119E for <linux-mm@kvack.org>; Fri, 3 Feb 2023 15:08:48 +0000 (UTC) X-FDA: 80426312736.07.3CAE1C5 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf08.hostedemail.com (Postfix) with ESMTP id 90CC316002F for <linux-mm@kvack.org>; Fri, 3 Feb 2023 15:08:46 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=OrVHU0jo; spf=none (imf08.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=1675436926; 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=68cg5sT+53fHc5ofdY3atwSg1h/zl/AMIkCUias8WPw=; b=tF6uk/Z7snrIXEVqv3FkukieFse29yD5Xu3wfheaQG5Mbhv1u2ZVhbdblUvvo+5iKwCwnJ xGPRWS9ZRCRYPwaG2yAL7rnCaSfcz/XBC22wZCMbQahp2Mr+cXKNF+ptvdOfgkWzSeXDRL Waf+px5+mJZyiYwef5njNVwD/PJfzos= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=OrVHU0jo; spf=none (imf08.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=1675436926; a=rsa-sha256; cv=none; b=l8XpZrQlsdmIeatNQ1Hsw4fQ5sYHEVJryaocSQxGkK8mJibKkGFj+2UtNjjQy571oNJIjC fDmMamZdMRJvhPybIRGiAn3CGfaIsLGdmc62rC5G0yRfIegpGsoo4TdPn/fWIG23VekBeS bCc9RNv/eFr/a60zeAToJiKbJE0L1Vo= 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=68cg5sT+53fHc5ofdY3atwSg1h/zl/AMIkCUias8WPw=; b=OrVHU0josMG1tm0/qll5D//KkE sHB2FVfpIhpYTK7rLXJfQyDklsJwU4X0/58LWBOWDUlFRpxm5OX8LZ38On6gVe2XpIOPkeA+P8xoD TZ2DO8jwimsWHueBdTjTCX0C3zVEQX2st4MqlC1sZLeSZATk763qhW5Dd6aQJXWNFMvnnXAy/95Z8 TIBdyMza3fTMTZS9466lhnbRr1s77/RsbXXj8E6Xw/boPxxUBFIiwZCUCRBpZKvgXDUam/JKncbGw EiV8Ifcm45+2EeKCpIOEezYaOc4hDJV6kCVQL6LXD/9gGTXnlkyGLx8cGYuQpVJ8Hzh85F9kOLrSa NJbG5t2A==; 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 1pNxfP-002bWg-QF; Fri, 03 Feb 2023 15:07:56 +0000 From: Christoph Hellwig <hch@lst.de> To: Jens Axboe <axboe@kernel.dk> Cc: Ilya Dryomov <idryomov@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>, Minchan Kim <minchan@kernel.org>, Sergey Senozhatsky <senozhatsky@chromium.org>, Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>, Chaitanya Kulkarni <kch@nvidia.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, David Howells <dhowells@redhat.com>, Marc Dionne <marc.dionne@auristor.com>, Xiubo Li <xiubli@redhat.com>, Steve French <sfrench@samba.org>, Trond Myklebust <trond.myklebust@hammerspace.com>, Anna Schumaker <anna@kernel.org>, Mike Marshall <hubcap@omnibond.com>, Andrew Morton <akpm@linux-foundation.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Chuck Lever <chuck.lever@oracle.com>, 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 22/23] vringh: use bvec_set_page to initialize a bvec Date: Fri, 3 Feb 2023 16:06:33 +0100 Message-Id: <20230203150634.3199647-23-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 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: cj9rhz5tkbz5bcetwopqcs8eqrpdh7f5 X-Rspamd-Queue-Id: 90CC316002F X-HE-Tag: 1675436926-221626 X-HE-Meta: U2FsdGVkX18Mm2ZTz5+VnK4G9kFPj5HqTfNa6Cl1rWS7xKrCkYwXZBxzXG/7ZGKjO/rIxmJsRJaS/sXO+DoHi+hgKGEgoab17tL1F/ZQ2EOBq28vCmjeiBnGIMGcaYa3911m/9hcoCHDrjCT677p4XZ42d66aMNxWRUtDCjW1K/ag5Fa0OpiNccu5Zi3vUyGNPAlE0OaY7jYG0C7rMG5UBP69vAgz8c5bYG2U9/gRzcaRS/kI6SOovWEl/tP8dyPVB+Yb8TET66pYkRM+1dn+HZNdOv7jnil3e/g75ceQKv7YvFSkpJNxgs7WpmFucV+GLIFEU8rzVvL3rWLwK3nVur46O2ZP+pBrwFgqCxNp51BE4OPx7SEgtkQ2HJaVo3/h+TsfMyDU1FnVsfqqGc5QXQXlUOzbgardAPAY5SND4s/eHmU7aw5W23fw1FcChksGZKvdIDLqX6+Fw9vVWl1fKxodp29uWqFnyTZ47So98HDV9fWTJIJWb/yL4Y5wxtHxY6zUPCUbrJz5O421zRUZzApRob2K+CWwI50fUOtevNByhtf06UuDdnaoXUQ38vWVzLhkUk9ZHBm0h5qikfzOrQeZmjA/EOCeiMh9NJhKRJXG8h6VCvWR7omnfmVqrLkliJi6thgbsy2J7VqUEVUjbcnuhemYBoXhPJsfUqv4RDJHCzlSKrCQtu1xw9bjhObG/m8ZQfLLMaMKHuU+izY/PY8k/u8h8cgR5VzB4nElD21ehEHJ6ixds8scbUwdzOPSRLYgQpv1lUC0qw+l3UR7vPtcrcRGDNX3ZLxd/LZPaFtQAM/tERWf36WvH96S3P2GPer5fVMgUZn3JWIV3DW6iGHtuovEMhAbQ4XWFy/fcRMYQbyV6bWLrYp8lQsdDOaCUXtuXih0U2snaKed1ZGXmKkyzWLqo2bX+62gcrWhb/RlIvkq2aB+PoNkPYVlqaw9B5ew/Xn4sCoOsRB07N 8W7MUGcR EZIkl1v3SUH0DKyOg226g9S+7jJEna4UtrjDpY3f7C7drwv41Nd+x7z9ctb2vlKO84/cXTgxn8ARA5VhOCLETmjkV/Fc5dn3q4jO+VSK9GQjhJlEoBIHugsHjQGtjLRfyOQ5LWJrwbZ/tIsvQGdeT6nRk5iWI5E1XYRplN58ytQ209GJ6KWOb7RHhVdXjC+rH8HJirHOs/TP8VmxpTPxy+ilKGKnQVVADxwHNBzsKUnmKtab6Wslfuaiy84LTZFLUGlWoh/9titGqppQlfQeIwrdcCHy5e6Vy9re/1SizAtdnCq/FWUWZPLZQZglCt2IHOHwqwofJLK79fQhLz+/hwkcdxwQKv84GZJMIsC2nZdvciDn+QavM63ItuzP0TVVquRUFY+kWaPrtshVd00wHjfmBrk5Mi/ARRog4EU/eni2Gn/96OjGngZXdcYO0IVqD5xYHmSPVJqGZo/Hpq0JR6jzSUG3wxQHKEA9lsCGupNnu8bMzUc1xHHpJRFJYRFRICwqX 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: <linux-mm.kvack.org> |
Series |
[01/23] block: factor out a bvec_set_page helper
|
expand
|
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index 33eb941fcf1546..a1e27da544814a 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -1126,9 +1126,8 @@ static int iotlb_translate(const struct vringh *vrh, size = map->size - addr + map->start; pa = map->addr + addr - map->start; pfn = pa >> PAGE_SHIFT; - iov[ret].bv_page = pfn_to_page(pfn); - iov[ret].bv_len = min(len - s, size); - iov[ret].bv_offset = pa & (PAGE_SIZE - 1); + bvec_set_page(&iov[ret], pfn_to_page(pfn), min(len - s, size), + pa & (PAGE_SIZE - 1)); s += size; addr += size; ++ret;