From patchwork Fri Feb 3 15:06:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13127853 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 E26C1C6FD18 for ; Fri, 3 Feb 2023 15:08:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 877616B0089; Fri, 3 Feb 2023 10:08:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B0C56B008A; Fri, 3 Feb 2023 10:08:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53EF26B008C; Fri, 3 Feb 2023 10:08:17 -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 3F1CF6B008A for ; Fri, 3 Feb 2023 10:08:17 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 121741C5D84 for ; Fri, 3 Feb 2023 15:08:17 +0000 (UTC) X-FDA: 80426311434.17.B6A74B7 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf30.hostedemail.com (Postfix) with ESMTP id 5026C8002E for ; Fri, 3 Feb 2023 15:08:15 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Fr2nVID3; spf=none (imf30.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=1675436895; 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=dnA485lnPdqu9fRBS2qkCU3tICV+bOtSo2Jj04+TH0Y=; b=AC2I5yIzErRY4Pbs5iLHcglwEf4VrJnzgTaja8+oZ7YHOPOY5e3Zt3RK89xcRLEUymZ63H yR7JMpcAS2mEBCNCeVSxL6jFIR86Z7XgBYIkqCDjk7Dh71H8NAtoY7RfRueDhIgtzqGOOw 3vjIeSLyVBNAyyvS5sM3wkk0PdpVZrw= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=Fr2nVID3; spf=none (imf30.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=1675436895; a=rsa-sha256; cv=none; b=gFDPnUClvgFSoMfwJQW5AA6nx4TPvvTIzktQbd4pfpiVYF5UVTIOs04nk33WdX0J9czTeY 831MuzHpo2V0dzod9+O30ekGHi+ldy8p7p1vrXO5ZicWJmvUTXeSBSjD5qLYmV0gpGOrHU N0PqwupgBLLe2QIhePyuiDMQo58LgHU= 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=dnA485lnPdqu9fRBS2qkCU3tICV+bOtSo2Jj04+TH0Y=; b=Fr2nVID34QDUltwq0bImkCeDcO /+q6hVRTezRnWD5cp1Mt8wSzR/8lRaNN26QLIzpNwWbueekXAbFKEYoVgwcbDX2xmbETrpybVdFvq qckHbNtD9VLXkwDO8SNcKq8lvYBhiXJr2ALEUy5RbTaChn5QTA/Z6DCFTv4Zkq6K9v7KJu1VCB6Re CVRtkwXX337WesOCBDtZMPzjTxDB7Z/AObQg8qfemm5wGp90YF61h2quDouspw0vBMUrHG46AIt9u jHsBTrclwFPo+jFVAuFu3TRmQnJP2IFco6pruc0D1NUcJz8lug0gER+d9PHihFfSuj858y9ENZCW3 YwwUYTxg==; 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 1pNxex-002b3m-Rl; Fri, 03 Feb 2023 15:07:28 +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 15/23] nfs: use bvec_set_page to initialize bvecs Date: Fri, 3 Feb 2023 16:06:26 +0100 Message-Id: <20230203150634.3199647-16-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-Server: rspam03 X-Stat-Signature: m64daupd8y3b4bbkotd114xajm5ka4j5 X-Rspamd-Queue-Id: 5026C8002E X-HE-Tag: 1675436895-283335 X-HE-Meta: U2FsdGVkX1/gH1/zJaQdARap/0uLbo99SLWkwsew/yBB8VmXu/GUWeSM+FpbDWLKPPNh/1OWAPhi1Bo7p7wL1r9VzuiXORj9RyiKp/maRxmT/lDvtI67PQuGpVpOQo46PZtQYeKYl6QoITQyNgQRlYHvz+LYAnhEBt6OTKl7E5JdGzYn/bvsFK4aSDQwee0l2jMPOhl5RebQdMLyuWsG0cBq9E578MyKt+/C7vIRw99RIGmzSraz+kiwUGzZbsjRik+5NKBnZx68gN6nylcLyuAnltsZNcKNYFXLhjB/Xr6I9ewKQv4840FI6TYOesTZ/qylBVdRjKh9B4p8YB/AioFhJOd1eVLI+paAqTgLTmDfi7SsS0YKxA1IadKSMM1e04T+v0UaHlXp7FnCC7C181kEXrzlUaFhf+VEpWF87/9cyrZFnM53bDvHaxkbE+/O8VPc0DCouy6XIpSEfVr7ZNT/9Ci4nF7QigpwCgJe90xcSDkUmaPm4fXOKSpHsz2ETpDw6tYirw4AIKlvDu8eP4rNBG+fqm/NBwlkkShOTo5w39uYzzGgHggiBgB+MqWSjOZplXzA0tHvlFb+Ghye+H7utwR7KvhJGPFQe7mw4Fg8aHihYarW2LKYE3RGAhcZvV5Vpk1KVFrZye2+98HMlc+ccegoT/+iFxB6F4xc3Oc/HT3IvuxpVWFlr7w4Yy00zAPAdk3mLD3MxfBHYdIa8hwJn8BGWewBLQLANSw2TirPspwh0jXYH+MLjIwS+syZVud852T60gnWYPWlHApOwx1FSEojBU5+ub5eVOXBZob5Jm7bwDZOJipXC/Sfd+paOnkPsnHpXuwM2GzkvlsSUV872IO340UOBniJeOoJaZtqIb+UphrVSK1MY1+S+XPAbnNI6tQdyl9+88GKAlDDG6L2/sHFm8qrNbXGIjeQDh1oA1Pw55S3MaUn4oO7DE2NCxCReQclvNroU/XslCE jf8pDn9c 8f+LflKyDzCxozETYwlnDw5QnUyi4foyexE3wDPtfA2yBQDCu2mpfSvZUqFX5xv0mEChxUWYqhzgxTYFZkbHv1lMem3a1Q8OGS9u6jmn/b032+MUMFGQxLRXh8EDytgQr7DTdrD8/mYUWEYfpFskXeR4ANlqS2KHicwPaxwb3DwJXVx4HMlsQfJVIN10j/gERU1w7kKeUHQ46amRrH2I4ua+nrUz03mOYAKdTcYGqPzV2LOdVzK+vLsUNhWHsGcf/tapZaCS5V/rlVh3shGkfSFgCNh/ddu9+F4ADf423Gu9rmr6+tfL40GRQgX2oqm0SV/KCsE8bCugcCnk0Bc++7tNsoOMmSat/4A9OAYL2cyng3UbFDDuRAISVBj3Nd5Gvdv8z+9UPp48QgB+KtPYFWg+ORC/aukncnjuDfNfK95PGkJinfVel4utEER6j35VtSefAlCl06pPszhiEsok4nCtCkFtsnJXeVVtMRAZrmik409Lk8WCWQubg0479kje+ZJ9IO1ZeOFAfJAIHTMElhOBXAFAB4n9XTfFj 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_page helper to initialize bvecs. Signed-off-by: Christoph Hellwig Acked-by: Trond Myklebust --- fs/nfs/fscache.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index e731c00a9fcbc3..ea5f2976dfaba4 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c @@ -245,14 +245,12 @@ static int fscache_fallback_read_page(struct inode *inode, struct page *page) struct netfs_cache_resources cres; struct fscache_cookie *cookie = nfs_i_fscache(inode); struct iov_iter iter; - struct bio_vec bvec[1]; + struct bio_vec bvec; int ret; memset(&cres, 0, sizeof(cres)); - bvec[0].bv_page = page; - bvec[0].bv_offset = 0; - bvec[0].bv_len = PAGE_SIZE; - iov_iter_bvec(&iter, ITER_DEST, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); + bvec_set_page(&bvec, page, PAGE_SIZE, 0); + iov_iter_bvec(&iter, ITER_DEST, &bvec, 1, PAGE_SIZE); ret = fscache_begin_read_operation(&cres, cookie); if (ret < 0) @@ -273,16 +271,14 @@ static int fscache_fallback_write_page(struct inode *inode, struct page *page, struct netfs_cache_resources cres; struct fscache_cookie *cookie = nfs_i_fscache(inode); struct iov_iter iter; - struct bio_vec bvec[1]; + struct bio_vec bvec; loff_t start = page_offset(page); size_t len = PAGE_SIZE; int ret; memset(&cres, 0, sizeof(cres)); - bvec[0].bv_page = page; - bvec[0].bv_offset = 0; - bvec[0].bv_len = PAGE_SIZE; - iov_iter_bvec(&iter, ITER_SOURCE, bvec, ARRAY_SIZE(bvec), PAGE_SIZE); + bvec_set_page(&bvec, page, PAGE_SIZE, 0); + iov_iter_bvec(&iter, ITER_SOURCE, &bvec, 1, PAGE_SIZE); ret = fscache_begin_write_operation(&cres, cookie); if (ret < 0)