From patchwork Fri Feb 3 15:06:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13127850 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 84DDFC6FA95 for ; Fri, 3 Feb 2023 15:08:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 541BC6B0085; Fri, 3 Feb 2023 10:07:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C9B86B0088; Fri, 3 Feb 2023 10:07:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27FAD6B0089; Fri, 3 Feb 2023 10:07:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 1178A6B0088 for ; Fri, 3 Feb 2023 10:07:59 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id AA22616115E for ; Fri, 3 Feb 2023 15:07:58 +0000 (UTC) X-FDA: 80426310636.26.99310A5 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP id E8A3DC002A for ; Fri, 3 Feb 2023 15:07:56 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=NsY1QrIC; spf=none (imf10.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=1675436877; a=rsa-sha256; cv=none; b=GKNmqhP3qHpPgDfJLrX53GruA3rKlwR/0o6g5PleH13bCYQh87XXbpB9Tzo1e4zXbYr7qk cUoALaSK0g6Xlr3YldQrzr3HkuVKkvNZ3X/UmiBmEy1jm0SvuQPMcUl/rUFcNqK/Pk86gU L+bVr09Ebz+wu689AUfyfgh0+JjvtsU= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=NsY1QrIC; spf=none (imf10.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=1675436877; 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=ozMZvF4F/akQ9A5h2X8GtqkaNdRpJcsfIZKKgUgmw0I=; b=nslx3mvWOy+yZvds9KbK6k+oI0rULgM02d79unliERuQtKyA4u4kQnm2Ek4QhY19sDH9kW 73SPS/4xthr+ZQ//c3WENidQp9pCAUclfwSSbvguz235kwhJztlTD+T5Dv1bWAamMwG60L CS19c0GYQAQXjL2SuI5I5BefnaqPnXw= 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=ozMZvF4F/akQ9A5h2X8GtqkaNdRpJcsfIZKKgUgmw0I=; b=NsY1QrICJKTA+CSUtrWle0mKa2 J8/RIQxPFQRt+FyzQ5NfhJil6+wd+Vb1D0lANR0aVtsgTqodWoWyn5bYXnbq9k7gnNvwyDWOjhkeR vnNOu6CYMAtSzcM2d7xE/VJ+c/Lqtyh0gd6yJ7/d9sjsVhHj/kXrmNHvsVdBtyYWbb7W/dpLiT/IM B0pXXzhjJtTPTahY8zyMrMcj80kL3+TPUMaY5LXlHXlNwy5kPByoRdWKg2ObicNbgL+lI6oGB5aiz BDRVVq4nqS8SAUegJvU4rV6rHUE0xE+U5comPu5ldTD2+F2GUfxaZmug0p3m34pElQJqYWaNcG9FT T62fXDrw==; 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 1pNxej-002at9-3V; Fri, 03 Feb 2023 15:07:13 +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: Fri, 3 Feb 2023 16:06:22 +0100 Message-Id: <20230203150634.3199647-12-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 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Queue-Id: E8A3DC002A X-Rspamd-Server: rspam01 X-Stat-Signature: nqdt5mjt9gywmsocdxj97pm7tcxy3p47 X-HE-Tag: 1675436876-1653 X-HE-Meta: U2FsdGVkX1+XCM18P9On3H/yyiyA4PetAQJCPXRe+5oVHLNBuWWQQReWH90zAlVYjZH7grMaMBZxpxmEM54rM4oGKMffJ/D8sR4+mBjuBGc5QZWBXaud4LUSBorTuVMvW2ezxiIhKucL0Mk5dBRpqk53d5wPbehs8P9BYOVryrHHJ+eZPFy8ZN9WpNIv3DqD0s5mJ8xt3MbxE0iCPNr36Pm+p9jKo5Vp9iC1iCYseILl+KBYon0QiwNt0J8idYV3NAbalR7eeyX2UkR0Wi0VkqrvAVe8N1ZkDJolTN1OM0RSa0pVnGHnIRpN5MsXX1tx8ab2GBKYFE2IfRmcrD/4QDGdtgjC1+Cet4xRO5jzq99nnU8OtWKS/vMB5Fo9T2cUtjaX2V9NqIP7y2TWPr65EsWRtHKRwHvrUIuy1NyhYICWbBIUX7T+qIqoGmqKMFK8B8TGvFTNd3jJJjTLxPce0PCDgUfJHxC3W21aG7EYCyO4xE7ze4DdpNsyqEYsge9m6w9u0BNy8o0W/ad0Y05s6Ne2MUdDUNn41CpWnmhoVIAym+vVniNPttHcpapssufkr177TvKdB8I1lA9WN2pQZGhBKT0FEWbpdObfaO63GdTzkV3zF0UJQRNTbU9PEkb5aPJB+3nPAvPbCjkb+7u2T4FgXPwE3cMWQDkF0/4n7Eqe+e0u5cALLG/XBUb7VeCR5/+sgulw8aIuqwBe0RUWfkpqPJEZFK6yBk35eSV8jItjjjGGYBbdpkH/KkaReF0jqsRKXgmWPFuaUN+GU7LJPMV5+pRLTRoy877o7AeWnO0yiC4Mz6K/DdBUXRnRPHg3PBCfxDvgbvJ2/0fMBANihLoJ0mcQZ4pd+plCLLg+h0hyi9BmdMCRuJqI/qq2Tvb7aQFYPjHHQcfe17WkA8b1cJ61SQqAWnwJSzlKWjiUW0uY7l+2zCcj9HjflsdiYLKB8unHeHIYSBGO2V+XEPg cSri14UZ jNA168GcC8QCwlcKIJlNumHayCL4lWCmuk9AuiplRnbmkqbG/iiHyeg+jq1g72YkcSMPCEH1hNPapwfg7bmgR9eIuHeK5N7HnBZ4NWDP0HVbe5PDKdgZNUQ8cyJpYvtoIDmA453TmPK8SWL1tXjdJDBY7G5qRdL95m+CMPRJfiWaBy0CHVPqs90iNPllS8Mbtt3QMlEEaDAJO6DZBv9wTqMY4XCzz770zHMNLgqVEF3a9yFeI85Jq9xlVmMsGXxnuJE3B32MxL6wLJUnkD6NcxVVwZ+tOTn6dvy1MRw8nCXWrcX+boDPTTQap/W+/khUBCcN+BY0fmaFj431vsk86r/o8uM1WxoMgQSfD9H7iHkT2ZNkKCEEJ9B4KvXNt7iPaR/GQy/FfSy7wgCTd3QYd8z8SA1T1ldJTKhQgrWCGnhgH37NtBWeApKLim+yWwf8pBcUpRqCNmXWprwQ42J3HmWTUDoLKduTKSNylEUkREtlW1mE1vwdlyRWYkTPymzBuVhrz 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);