Message ID | 20230203150634.3199647-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 30801C05027 for <linux-mm@archiver.kernel.org>; Fri, 3 Feb 2023 15:09:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE54B6B0095; Fri, 3 Feb 2023 10:09:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A94856B0096; Fri, 3 Feb 2023 10:09:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 935B16B0098; Fri, 3 Feb 2023 10:09:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8171C6B0095 for <linux-mm@kvack.org>; Fri, 3 Feb 2023 10:09:29 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4CE3B410BD for <linux-mm@kvack.org>; Fri, 3 Feb 2023 15:09:29 +0000 (UTC) X-FDA: 80426314458.12.1BB017F Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf29.hostedemail.com (Postfix) with ESMTP id 88CAB120004 for <linux-mm@kvack.org>; Fri, 3 Feb 2023 15:09:27 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=opeqTYIs; spf=none (imf29.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=1675436967; 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=hULplBzcMJ94viLdBG/HNvtx7Ka8ccUMgchbzO3OdKQHQRcmkIU9mKMSt6OBKlH0tLqNNd +VERY4K7XfJfied758fB/M2pJxqGgls8TCc2yJTRVMhQpmc1fdM4gWTXBURWSK9rilWWbw A2VFBFJeqcBJFf8NJLbgb0530ofeH0U= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=opeqTYIs; spf=none (imf29.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=1675436967; a=rsa-sha256; cv=none; b=YpDTMMZyg94nGgIf7BMOpHp9nrFp9LefMIQjpWPH0LND7LvuIkmb/WKuKnO4Ad0RWH9QNC xWwCnnrolfOuTVJtpYSr+pKpdaOHgD4r64gDgOH4uxo8/97a6zy2d3r56hYrrH9wJCyRZl c2+3KcdIEITm9VQUgZDWDrMT9ElUEB8= 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=opeqTYIsDd5ySHkM8/Z17yOBYI EYj/TALLVbPcdK9L0xzB5abV1zpI5xqkO2L2YF6MxMZvyva0gUzw7pgM34AaCSLiLPIiDfg6ywwlE p/uz0Hp+FcwrBScWBZ4n4X2ams8XcFdxqkklIPUnlIp6crcuB/NPS5dJIyr64dZwb44pwvjVg1Idr gjtWxsXOoyGZV1XK5Kjfjy+OQZ/3a8RJDFtiI3W/17L8wvNj+WCY1iJfsOS/RvmqrXRrNn9ZnCGQY VbPrXwoOPchaeJVVKF+sqRUov+yXi3gGw6ZN19Dh+G7on2Pg9/Hv3nMZoM1b+AA1D0a86INXiHkNn kOEksMvg==; 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 1pNxfB-002bFh-IR; Fri, 03 Feb 2023 15:07:42 +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: Fri, 3 Feb 2023 16:06:30 +0100 Message-Id: <20230203150634.3199647-20-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-Rspamd-Queue-Id: 88CAB120004 X-Stat-Signature: a5zgjf4s7rpyorf4b5m7yy6mrjwikg8d X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1675436967-914038 X-HE-Meta: U2FsdGVkX19bptHzTxgpWiZx9Ibh5biZZ6Kf7diTPGirKChByVfsS1cv5ib3fdk99AV0xqnxZKSDBbXxKGZ1Z/pAnUveG8+4itXNPXPD51lrTh6KCQUyF0ZV+dzhzsMc6662ZCL4iO0siHT8ozvJ/TFkcopyLKl5CcYc0BMihCYcFV1GSo9+kAj923xFHlDVoGjYZrY40jFs6tTWbAz4C+oAzgwB4By8HpnMwT4Su8cfPAdXdu1Hj4zVjYh0Xgvj8msyy9Sl90AlLyfxlJKd5BaRXS/xUzn0lSx7xlreqE48MvhymrIpPrX9J6oltBjqrenDKD9cwossCeE7SlEVOuExWfb9bkqcKIJUIAKNJcT0pBXrHH/wFdG0BLFX/EK45BsVQoPrfNhV+HGrwlPqRexCDfmXZeeFWMK93whUZnuttgIvaevySgel2iISkR1JKaEhdTfqYDwIh+Cq4ViFa18xKW7kp5M2zxyrDlY65q+g/PFL26ycSPdQ2OTjqe//Ukh4Y7aG6goHcVhQUcbGp6RMrSyBbIvBlzqbxhgWU5EoYKvc9gd61zSmD+YC7Ul2SPEpbGt0hWcdW7C9JQs+8IOvhGqaQ1ECzhUIYsSE/Av1d08/xy71tCjiGAeg7UaN04Qh0hqt4JZccEyUiHUkFHbSFfyP5tjd/HKD5GMv0UI8bsnsaBsDExLt2gwLlHeZ5kuwew4qzH6dQcwpNU4Z0rW6ytUJ4H65AUpQw8/li9UZW14aWH1xPVVnTsytkyhr5afCqWvCQQSy+kYr1oOcAoWPkHoymdy3r7nG57oVLrk90iZgK9OmV2x5pVymNIBTIsrVADwfOkaoWHC37n9+mkXhMOWSpElrVO34xYhaqQlF9W0iKZ5y4LeZy6+SSHLEnoTh/UDuPMKh+TWMKLGt0Y+4ItG4UITY3BYLRkcRKBZ1ycnufx4xzJvW7qvdcgFQcmhlphHUa8Rnv4EOsy0 DVAoW6RV AgtkhncBaAceHxrWM+vN7Bb1EFMhPVFKA3t8sLWdGEK8KyTbcd/Osq6fPuiMyVnW9vI/CyPoeBOyw6Kn4Flzs6FuJVo+Ij45OAmGyjAGE8GGf6UYU8sGXWeMesUGx0/7xPIdOczNtFlw/fkYKd0NZ7FsLi3aC41/Qos2LrGagKOq9nwys2inyTtsgdfL8V7V/E27hlubN5Ib7nQjB/FRJ5vDcwyPwGBlmXYVa4OQEdZ90r5JwUd3SjWNYKYpik2nxEwB/bTUg2NMQd8So+ltNZ3nDslhFagNO65+qjCnVa+QlopX/UmC0T/VTC3HDLSXXc4pxxtXJ+oAmGdbJGWSJ64p8y9v2DezBxpl2CHPovJ/O5NgC36v7CikPEaG53B6/yNv7pH7w9NrIEXpuhI8lqaXV/bUchFiX4AtObEIwSBVM7NAxD2fQgo6bVMC00RpBNuuXnPlNLwxHkv6/cbkq0QHwIbIKi8Yg8E8G 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(-)