From patchwork Mon Jan 30 09:21:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120642 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 C7C5EC636CC for ; Mon, 30 Jan 2023 09:24:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C38A46B008C; Mon, 30 Jan 2023 04:24:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B89226B0093; Mon, 30 Jan 2023 04:24:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 91AD26B0089; Mon, 30 Jan 2023 04:24:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7D48D6B0088 for ; Mon, 30 Jan 2023 04:24:45 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 58BD6801DD for ; Mon, 30 Jan 2023 09:24:45 +0000 (UTC) X-FDA: 80410930530.18.1A16B37 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf02.hostedemail.com (Postfix) with ESMTP id 9D70580003 for ; Mon, 30 Jan 2023 09:24:43 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="0U7C/4XV"; spf=temperror (imf02.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=1675070683; 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=qP38AeUO0Rmk+VJkMh1f6goA+lT+IUSKmsc4pvMdtPc=; b=gFjZB38YTTGOemM6uWtZgRG84bWp+wVLM+EXBpBE/GpDeq+q4auiGtoRpYZ53KV+kFsiHs X0vOgpLCpNaMF3d2XrPXN//UOGDrfcZSDW30nQmHOpusaZQByrBUaoyXz4frUGgMS5EW7o y2dFXp/nSd814NCa9mNnoCyxghNjPQQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b="0U7C/4XV"; spf=temperror (imf02.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=1675070683; a=rsa-sha256; cv=none; b=75nEOjRTwqnIspzQcBUBISJ6qhXOGRJCvBTuVskV4Ws9eTkib64QKlBD/1K5Z+piap7N+l S5coE1JUNoj8uGqU6OmtHwtSqOn8dH+CijYDcDL9EqCbW5o2hcpCbxGnE0yN1xAbbJcX9r Q3o6qMCss8ItXHDbf4CPwDbB39BUmEI= 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=qP38AeUO0Rmk+VJkMh1f6goA+lT+IUSKmsc4pvMdtPc=; b=0U7C/4XVekTjj+yEkY+iPbVHS9 SCowiG4W/On0oC0DNts1jXCq9PANMU5TUjGyEzvCijD/oLG1m+VrJYiNlUNGYBjErEfnFoIaWXips Gq6HKuysFUNiA+dHDOA8lPW1NJrEyhAS3EvRq0MYqc1fbaCN4zTed7e8bCwvFLNiLRhH89ZXkRYWZ FwX12RJjOzkFSnF6rDP7RrVrDM1m8vuCfiYubETB3lLkrwswOgdkZmV8ceIYxk1be2k15UTBH1+s7 TP/jadRuAY8HqN/XCCqPHefZ1IPYFmZgmKkFBJP1ZRIdSdEy6x6V7+/hRtYyooMunB7/mc5ClXWZB UVK1amGg==; 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 1pMQNH-002oGb-QE; Mon, 30 Jan 2023 09:22:52 +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: Mon, 30 Jan 2023 10:21:49 +0100 Message-Id: <20230130092157.1759539-16-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: 9D70580003 X-Stat-Signature: 9dw8u9za8ayy7fsnsmkerohjrywy4ezg X-Rspam-User: X-HE-Tag: 1675070683-953129 X-HE-Meta: U2FsdGVkX1+kbtw00HAHLLy15xPVIt6YXnFTzBrmhRt5yN6+52ENYc63IQfZY1KsKMgp1HlvtQbKEQzokBu5VXBxnsOrTgjlCDx3zIm/cqjtn2hoRatFQhqmI8QS1h+UIlRIKF35fuEaeS8on9wr9BLPjbJBlUCK9q/VINDnBaL8iv8Lwu897s5035QtBA89iqaXEaecwk3J+XgnyQLPL479+Ga4eVRfiE8cnNqv7/ao9QlHJO0vXAEI6frcq6aQ9rABLujT/9O+SVddKmpr2hfjX6GKbEEkVP8m3wRRUA4Etel61kk3aRyGk+gvNdyWcGM3SzV7uz6hC6iyuf9sa6waUXDaWrDifVhkw9L+o97aL6iMgNBAQVuMJUSMDdxaZ8VDFFUkKqQbPEV8NR26HxC7xWL2RdOX07bm1DFfm9VMeebY7ZcmUHVcn3n8fAsuItVYMcmPXvxraOuulJ58VNOdzc0BCkcIFInI9XhK/9MkuXDO2UPV8f7S0zUqINXdmSB3JfPPDVdOy4111WyLOP6IT0dGVG8RPyOZRbklAVbaQ+P0ZP4DVOrUy/GZanlbrsY4RtdWziHUb4BDjJVIq8OvlGc/errCk9oJGirDRPwpHQvORFU6Aj8oUBboLQm/0+HOptkIsgdbIaW4hTn84F7VdUb5x8pWUH+HVHHD+RQSZkgzaKRxOfFL5AwdcqUKfsnwSPg2NpleXJjmsnJ4cCwlgax+zPUryRs6Woq56UgnLumvD83fzogAEV/d/DhEJBq2J5AnaeQh5ecqtyGkHQM/eqDDkfLAGBNbKpA4pC0fFvBLAjDNo/wtYc/ZZpbqquP/Ac+vcTf5ftoc9WzLcyIHqsGn5lovpnVHuWSqL2/NNT0GjizflRSKq76GWxfwRVKlVbEZlsGxbvLx0BqGQF//ywOhxlWjWddaoLP9GMK1TM/Zz2yFGEjqaAfItEw4d1hc01vs7Rh2U3+Fvz6 xRVUpu73 FvTldZAz3PkIzgF8hHtZwEMtSzMMH1XxHR8JHMwT4xNDd3/EdYfW3TjCITCBaETrWPb9nt17LizwBNTmdk9JaWPTJCVAkHtPFCqE/tfMhuHcfBuM4TJnIVsZybxBGnknXmxKeuHZVPn0u0MLJxvp343PfH6Yuv/ClwK50zAvVBeWL11JJFgl9aF7/M/HafeOUzk+hhWdGPMnOA176O1lanRDZJb8GqhcfZTCbFCbMD7zHzHqXvbMfLGsTyVMejc37phDmCnX1b8soon5iDWGYuP8939aYdyQzTBWm5VuERJKUWpxYtxDGG6AkrkyPuao+7HdZiGHa6nu0V4JuGCXQt19ve4h1D3BlMtG5X4QL2dhMTlNwh9HXdE+KYe8jMr5wjxWw9zOgy6K8RIT1DP9r6R3vM+uMihJban8oklX9mrVCN8+ZEGHLGj6TTQGf8jDSgUhHbkk1wmXhXMLIBNFkeaKZ4cEhi0E57Vf4PNSTFV6IythGXJGCQf6ekg== 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 --- 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)