Message ID | 20230130092157.1759539-20-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 9A3D4C636CC for <linux-mm@archiver.kernel.org>; Mon, 30 Jan 2023 09:24:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A1D236B0089; Mon, 30 Jan 2023 04:24:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 96B286B0096; Mon, 30 Jan 2023 04:24:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F8AC6B0089; Mon, 30 Jan 2023 04:24:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 3B2656B008A for <linux-mm@kvack.org>; Mon, 30 Jan 2023 04:24:47 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 1E633A0A1F for <linux-mm@kvack.org>; Mon, 30 Jan 2023 09:24:47 +0000 (UTC) X-FDA: 80410930614.02.EC30C14 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf07.hostedemail.com (Postfix) with ESMTP id 75C6F40006 for <linux-mm@kvack.org>; Mon, 30 Jan 2023 09:24:45 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=iooTsOLV; spf=temperror (imf07.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=1675070685; 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=h+lHe/qj9+NLcJnalyqirfAInpcSjbUKRj83r5gu0OY=; b=y9ebo651owl/GUUBjpUTGeOZQmeCgwd+Pbrg86Bg878tK1UCK2KLuEXbXzk2c6GbH8ST0d vZeFe0dcijkh24HeDAi3klv18/2RTHSJGzeVMrqDG6TMVzS6oMPcxXYQJo+0B1/qjUVhzJ 11CQfqp130D1IN5tyM0eXsF/1IdIMfo= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=iooTsOLV; spf=temperror (imf07.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=1675070685; a=rsa-sha256; cv=none; b=7ndVPRvKGKOyoYOIw5FyIfqZfH6ya3/q0n4SQjYa8FtFmUSSxU7jse+x29J6iBpdkwLPk9 iTQfrQoHJ52aI1k39r4d02/tYA4sIWDYrSU4vu1zX7OmMhzXrKvV+mM9c4gYc0Kh748rkt RTPnJjIIsco7Jx+0PL/Wl4Kix0+1/gI= 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=h+lHe/qj9+NLcJnalyqirfAInpcSjbUKRj83r5gu0OY=; b=iooTsOLVmKIL/ixriJ6M6N2zLV p0LtPYaHnApKmXktbqYtS1iBIChQE//OrkhC9BejFL6iJyQ/YmCmQDM8IAHebGZsoPcKwlLZFMT6R rmqaY+v+wb+eMH9qR7ttcCPmX0HX3khYu/Xo5mViFs4Pott9I6Qn4V7/eQhFdGYEfQf3kZxzqLfY/ ev81DRGCJKNL78EcC5Kfpr1hFkfI1lCJxwKAWUZqu6xN1RHdEsT32y8265Um+OWOJ7Io++V+ve2Ny seVOYj7SyoEnFycVFd1I/7fULPH30U/wlBRK5hBih4Dqubnzz1z+BiP1/3J2Sqawgs4/K9IzZt99x qcn9+TEQ==; 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 1pMQNa-002oMU-Kp; Mon, 30 Jan 2023 09:23:11 +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 19/23] swap: use bvec_set_page to initialize bvecs Date: Mon, 30 Jan 2023 10:21:53 +0100 Message-Id: <20230130092157.1759539-20-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 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: 4745pd3851y8fecu5xm8tgmg7a4g46di X-Rspamd-Queue-Id: 75C6F40006 X-HE-Tag: 1675070685-901750 X-HE-Meta: U2FsdGVkX18drYfLSL3Z7q6ULBfR5v+qfh6L1ICZ40zHYHJ6tUVjPwHAeVFwM/tlU3GkkCZc79d5j8jxg3GYYfuw/wBF494VTRq58fBXJ7S5v3rNvZizuTuPJPOMfZWmReXsEMiY9PCp5l6jRxjJLtOOUBimPNicvoiLaunFn0r8ZgArDeVYYeJXkeBiPoQrH/Id/3WN4YFtVBxQ4bvaZWHH7zntPQ/3ZWvt+hdy0tZSpUkWAhCtxTWDyAevN+Ib3E49nsuMkN57355wA3OYdNDOmzLuWhdsU8DaLTUJ0UgbJbJ8Eed4KApUpOsvtE2bCEDFyUreCeaCSx4iyrQgbyYOXTpSD1UWJa1YBUMAQj0w3GzV5w0PuEO1nInwFd5jEy/HW/ZILARFRYQ3r513f/xll+FlJG8Meh6JukK0OFDZDK03LUSvTDpQwCj9io/dR2BKn1dlthi4jSlva9wVR1DjC8yV1p499MZ44cHg0XGMFZl/NiItSs65m2A0vE1yN+J13GCxIa+0lEru1e/rlDdi0mTGGudydoBfBqHn6AuOEZSOYfEGLaHh7RQa9i7ZPG7NQJr3dWhchET1UJb+O/qu1F8q0TGGLTjd/UFOARcq1lLs6ctulNFwZd5Q830km3bUu8LcLfvFrJ3l5k/wjPIXv+zebUZvCYXaqNHONCCzKI1UwM8px7T/8ARAgdCvPvEZVFpJcCVMgbvaewNEo/+//PW7MIKp6zHHMMtR4V5EgFWPhXa5tGGzMcE00b2peLzqTd60dNidJmbFUfOj9Yx94gIKGtj0IynJRKYqziOyeWC2jL57k1z+nSLcfuA5L3GKXZ+yHVXxkyWKXb9giYvO2aChNydiiaP2no6Y9tPytsd+vWU64ISKuOy7vNm7/D0Cfx/cNc4yQoh9jp53aSC2Nwb6AwJNsoIijqzv2nOYjTQAW+52qymr+yNqh0m9S8P/0xcotg1ED2Lipd+ GX3rN3iZ QsXrV5InFVbdNb+aI1NW95NsfIDgwUi9HNqJhH5HG8Fajh+0E6trk6MsdKgnZn3xb09X7iderTxSdmHNJSxnzDIa8J8Qa/Ol70KWDR7k3aJGWaakP18R5YvEmUUrawTuWxrycrNHQDKdclxq8jfWJRnRCdbvIFoJXHYrKIovBEo7lk1Z6VNLhneXi5glY55zh9hnxB2Mw6/pmBhKOLsPeD5uTiCWc34NH6ZBOKdKh+pjv4wXAgtRX2pobrZlWkOTiGvVh962bCF2NgpkArGZdzpRDFfTdQPz0N2ajHb1uNKZYyscBOwL/NT3jJmEZKB5fQ1+gCWcxrSOSPSTKs1rCp+FIZnDh/CaR1snSQJpkaXYf5oYx+fuCi8QapNi10+KZSy0M0ea1YBVQlvk1AXszk/0LDiFM6xlxfmywYzydvdYdXVwnsm0K2TuKVqEVM3TeXO3awUarpUalG7AAYC9mtDaNiRFKuD4gw0YzcfRL5Lq354gQXHJVLHiYQQ== 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/mm/page_io.c b/mm/page_io.c index 3a5f921b932e82..233f6e6eb1c508 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -318,9 +318,7 @@ static int swap_writepage_fs(struct page *page, struct writeback_control *wbc) sio->pages = 0; sio->len = 0; } - sio->bvec[sio->pages].bv_page = page; - sio->bvec[sio->pages].bv_len = thp_size(page); - sio->bvec[sio->pages].bv_offset = 0; + bvec_set_page(&sio->bvec[sio->pages], page, thp_size(page), 0); sio->len += thp_size(page); sio->pages += 1; if (sio->pages == ARRAY_SIZE(sio->bvec) || !wbc->swap_plug) { @@ -432,9 +430,7 @@ static void swap_readpage_fs(struct page *page, sio->pages = 0; sio->len = 0; } - sio->bvec[sio->pages].bv_page = page; - sio->bvec[sio->pages].bv_len = thp_size(page); - sio->bvec[sio->pages].bv_offset = 0; + bvec_set_page(&sio->bvec[sio->pages], page, thp_size(page), 0); sio->len += thp_size(page); sio->pages += 1; if (sio->pages == ARRAY_SIZE(sio->bvec) || !plug) {
Use the bvec_set_page helper to initialize bvecs. Signed-off-by: Christoph Hellwig <hch@lst.de> --- mm/page_io.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)