From patchwork Mon Jan 30 09:21:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120637 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 5C02BC54EAA for ; Mon, 30 Jan 2023 09:24:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 60E146B007E; Mon, 30 Jan 2023 04:24:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E48C6B0082; Mon, 30 Jan 2023 04:24:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 484906B0083; Mon, 30 Jan 2023 04:24:04 -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 3022A6B007E for ; Mon, 30 Jan 2023 04:24:04 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EC9C280425 for ; Mon, 30 Jan 2023 09:24:03 +0000 (UTC) X-FDA: 80410928766.29.15F4832 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP id 53181C0010 for ; Mon, 30 Jan 2023 09:24:02 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=QTYv8MI6; spf=temperror (imf10.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=1675070642; 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=waVJAjm2FM0jvuh0ozqoP97gMNRNVBgPKhaSSg5Yxhg=; b=xKoraSpUxkuOf+GKg3iQ6k82JxkDOB/kMNToCnA/rwxTw9nenHo4vbOzQqTyzc6COHZmfi +X6ArJ1FvHrmjz1MTvu706mKg6rL5kgJba8OuciqVlH/9cvGlxIA6UK3LgX2cW53+3ZUWf 4SRh9RQ5Es/4EE2S4XJE2HU2AjSMy2I= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=QTYv8MI6; spf=temperror (imf10.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=1675070642; a=rsa-sha256; cv=none; b=r6P3dt0Dm71hyFS3K4S2agtPOWxLWil8zYwAaKB7xDJvWXi98CQEbJk0auewL6++4YZDHy yD0UUtK74J7CRcBLbdFBNfPirJIlVg10TrbsMHR9dmW99YAScvdVnz85n6qE4VVDE6KYc2 UVMOcJz+6QHVL+TBWngoiDwOm1ZoHFI= 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=waVJAjm2FM0jvuh0ozqoP97gMNRNVBgPKhaSSg5Yxhg=; b=QTYv8MI6OQAM8sT2MzrC8lgZb2 L7Ft8VBeI/rYi4wvdhNRIkk+89gbjy9aIv1X4usSq3UcRbM2VqLo2MpOUC+5qfxyguvoWKr5GHx64 tYSYgh1k523R3StIKwtgPkxLbHoU0OskEf2l+H4ySafLO43GnmfafqNMYzVkxE+/8/4poWzaTQ/lp lqbYjeu9vuT/c1tSwraqQ+I68EOddD4ZaKS3cKZcGo/Z7QETCvghPhHpksAPizeLr7o5lXtEdKHIo O5+0BsnFwGf+zWUiSaEhgD41XRRwmBfnaknYFcKCzkYl5E0zbVQ6v339RIqSGz2riXL0D2RB56RfS qRVU0BNA==; 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 1pMQN4-002oBB-0G; Mon, 30 Jan 2023 09:22:38 +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 11/23] afs: use bvec_set_folio to initialize a bvec Date: Mon, 30 Jan 2023 10:21:45 +0100 Message-Id: <20230130092157.1759539-12-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: 53181C0010 X-Stat-Signature: tooqywba8y3firpw3o35ets9ew7jsbzr X-Rspam-User: X-HE-Tag: 1675070642-238447 X-HE-Meta: U2FsdGVkX1/tUQvq3iOJitaIBj1whdpuBaMG4r2uMt0JBG3JzbbF67MrYuBPxUAzhXjdPD6XTQwACZr1gFlVvg3OU4fJC1DoHh6GNlFu0TlN5Q6QSVjQPcNGndBH1exlb324y83ONKNmOfwXCKue5bgdgqhllQ9mDX/7EjTOIDL8dzCc0Qj+NAfx7l017wMoYEJ6L9UlmfrxtyLK1rf7YO5s9SHkukJmSCcTv6jWTiGxsvBNzylgjZIVRSnNKOiFGo8UWwtBAmqwTKIPA3yB/9Ij5IhmO3+Ul814EJSpWdaeb4ayQCDGQssd2b8ZkVee9skhioKBcsKI8NNPazLBXtJWmO+TB00Rsi5EZn/rcttphX1bvmnPiGKAKoC5tQeuogvQIhzh/VMwoPyTy+S9ZjRM+dI8CntbhPnprkYvFQcbRy9JmdErT6sLwvXFpNxb0nV9tAHJPfJxWdHpZgaxeLJ5oBW2MCMupepKhHBJBWDnP8u2XVDP6DLY6K5xOAY2K2M1W6Aet/yCrmkU5Bl6ibOgbdm+uawo0hupRIHC2/yWHaUfBpyk70uYjvBc15S6AkZoTgi4U+0bNHnMm9K/beVhj+2BX2qqDjWMrfIN/rdsVKBBBeqldQpQ/wNdPZPkZE3aZfczu4NrM/nG+8uBJE37HnSDvpPoF4ijaGof4dePTaFLHgJL4Q8AojOIl3vXtAyaDQraqukkmmPixSRoyLnEC9yn6V63B6jTCK1ytjiXqnSgF/Ji0nNURL9J8f++YzWk9HlwQqAYjbH/49Sv6r4gF2xaLiiXFuxI1vmgPmywTzb0VhTTZSbMDB28QXJOvHSFwrJq5FrHsdnyDpqnVCyA/LZFHhLgswVmH7WHlSiL0RyURh22JPqZ2Jsckvn4nUPPj/oxgtRLLIXAvpL7kEUs+jq20jceBjb+3k6/u4sz/FtNrZYHsFhJwoIQwyXF6ntEXcrnPd9ojOo+CcE L7PP+tjx kUpvC4qkc3OUidXeaxgPX0rth3dbe1MwY2Y/YfZzBzbCkEsC/PEJlwTZHnyovfKg0nsTFRZ2XM1GEi6HwPc3bFoGbT/qOednXu7JOj01QPnVQcKMI7Wrzb3SvOuuJ8XdadGqycRfTu/NlUGJOtBHnzAHXTb3NxRf7VogeKg7hmy7g/hCiEOE9jueWyN5m7YfYEarqp0cNzkj7VnmwxioTHygPXQi12oolxRSGOW1hfGOnMw6O4ucmGdsScDh0JsN0cMDeEUKt5+lnlUkmA0DU8XMNLR9k5Mu2OCEriCLUfwAkVIX/X2y6mdjAOUeFCobiKBtAqJehqBqsgI2LJzfjBhAmLPbGbAddj43JnjlooyqgbJ++aBL6xkFsN5TxKI3VcCdXmcI8evb992nboxvuOmYyEe+KV/20ikcfIa80G+zRH5WCf0VDgmqm6f49SSvvlfzJfqD3uOStonY71xTfyiEx/mFt2TDWWIyAdfSqffdGzW4= 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_folio helper to initialize a bvec. Signed-off-by: Christoph Hellwig Acked-by: David Howells --- fs/afs/write.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/afs/write.c b/fs/afs/write.c index 19df10d63323d8..2d17891b618e6e 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -992,7 +992,7 @@ int afs_launder_folio(struct folio *folio) { struct afs_vnode *vnode = AFS_FS_I(folio_inode(folio)); struct iov_iter iter; - struct bio_vec bv[1]; + struct bio_vec bv; unsigned long priv; unsigned int f, t; int ret = 0; @@ -1008,10 +1008,8 @@ int afs_launder_folio(struct folio *folio) t = afs_folio_dirty_to(folio, priv); } - bv[0].bv_page = &folio->page; - bv[0].bv_offset = f; - bv[0].bv_len = t - f; - iov_iter_bvec(&iter, ITER_SOURCE, bv, 1, bv[0].bv_len); + bvec_set_folio(&bv, folio, t - f, f); + iov_iter_bvec(&iter, ITER_SOURCE, &bv, 1, bv.bv_len); trace_afs_folio_dirty(vnode, tracepoint_string("launder"), folio); ret = afs_store_data(vnode, &iter, folio_pos(folio) + f, true);