From patchwork Mon Jan 30 09:21:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120647 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 6E0ABC54EAA for ; Mon, 30 Jan 2023 09:24:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B8936B0072; Mon, 30 Jan 2023 04:24:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id F0D626B008A; Mon, 30 Jan 2023 04:24:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE8286B0095; Mon, 30 Jan 2023 04:24:52 -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 BFD926B0072 for ; Mon, 30 Jan 2023 04:24:52 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id A39E6A058A for ; Mon, 30 Jan 2023 09:24:52 +0000 (UTC) X-FDA: 80410930824.22.B61A3C6 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP id 023834000B for ; Mon, 30 Jan 2023 09:24:50 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=yIyzvzQM; spf=temperror (imf01.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=1675070691; 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=JggVdFejlVrHezfZyUPZIF+fbKFzTvLqyM6x/B/bNX0=; b=AM7GKGoK4Thu2fbJzX61F4FfUcgjrl5pYWnhqsxTtgQadqM6bNuciEFFLNBRUkyAenqCSd QSWRz8Z89K9+DSFSyleearPMHE6QqQlhiINUhuoe25eZU4qGGFZ/dtoZjOEbpPBywXvxcQ f6YfZitXE4NY6DUeaFSTRN+DQjfWw8M= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=yIyzvzQM; spf=temperror (imf01.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=1675070691; a=rsa-sha256; cv=none; b=549NWOBmRnfgibV3XCRknZevDhZgDWvcmFWwP0ZK390mELIumtkxZyjXg2wT5Sdd94eHYm tfYLBmU69B+8a4s7+Uc8iEqjWoBD2zPIWTI3Ps57QaBWuaSHrUBiTD2QB2lrWgHGbtEKc2 Y5f7HMTuPuL1HLLjgohLpfnTVW8PcTk= 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=JggVdFejlVrHezfZyUPZIF+fbKFzTvLqyM6x/B/bNX0=; b=yIyzvzQMfPVH5Gb1fGbCTBoUMm xloJv91yDUd5JQdWLlRBk+1sLVwSJJvK1sQPKmxCs/LNN1eQPMeGgwtVAmuRonsvhzwxw0ztVLd5H uqTuZOrnXue/mLxyXQ899NpF62ExiwbTi/woLW4nvWS9CICI4bQ1XP2mMwUqoe+ELqlA9Ltt45QBS A1RN48wY4MO2whvwBYTYJeo6A20nM7cF0dsRRmfS8Ta41XMgoSLMfClVVyS2ZQY3DqywQTajuIYZ9 P1s4vwRo6Pu1l3nmpmKYQrYw0pvU+oaOEhwJk+puAKc1PPGVc3KCMZJMyOB5E9Yi2nzwi5ZdtIclp AQmElk3A==; 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 1pMQNs-002oRV-Sa; Mon, 30 Jan 2023 09:23:29 +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 21/23] sunrpc: use bvec_set_page to initialize bvecs Date: Mon, 30 Jan 2023 10:21:55 +0100 Message-Id: <20230130092157.1759539-22-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: rspam07 X-Rspamd-Queue-Id: 023834000B X-Rspam-User: X-Stat-Signature: iemgezn83oi4hrqfgyau1apcxhpjb7cp X-HE-Tag: 1675070690-974763 X-HE-Meta: U2FsdGVkX18RlcvqAC3Zuz762HZ7ELKN5l4zU8WV7Qw4owrLb3QS9YeB5eeM4GZ6Pb9cDvDeg2cGSMgbDvIrRSkO1IqiJ/9SfklbDxbOApDVKWK9FhV+2E32kwd12G/G+m0j80GRiNUBVglZdRkk9OJERoy6zMJKG6sAGStTzzxA4dWnCp3Ckxv0IkNMqd8bOdyQTBe73kr57Us+mHdEK3INnVHHZEq3SAUYnN3EEyk8PbdeDmrdxO+SnvhLspOW58McHPhDtsLNitRUuq3Uuvfrdv5InDtypHejFuCUPsr0a+Rsx10M0H6j1K+pMVzqUHYwF2xPOT+fxT648NFrcQJq4i6YVXKYQElBFj1JkBvgV5AtW8SIoak+dCiqETVuWdwcqXZMncvx8DDFkqUk6PMSWWtJZrh4C0866RFppL0sE19pI2Ujj4JUWZVZQ1rGQvoRpgY+d0ibWEYtv/lPpdoY4RxDf/cXmk0N6CLWyuDyymYLvksRUgAk9Rr4QH5rLGA8IYojYAT6mpQJkQUZ9L3x53WhHjaz9Zv7qy7PBbsUpHLsJDCQUPixYSaEi4xBKS84cC9DYNjPO3aSdOx+IAYDovigWmGkqaWKMXQ/sf5ib1YGVS+QY4L+BoCG6udbqgeXyWYzZ86W5VzZfbLnRFp6iViIpNKFhnhG4t9Qmbe4e6djGS1AlQwkPneRB2DjZ4G0kJU5zulYghMQwWEoFAZRyGArFKW8+jSSPbPFksiOyi0XFiXcEYAjo/W195mRW94mWBrH+8NoXGMfFkGrQP/ZtzCEFr3qCuhPDNfyC82QZTUvt/FPW4+6HTYmrZ4GV5cg5K2RzKwZI4X9XmeaUNV4mlzNJYRrjKDUQAc9+SanGEvssNrQbhjHJvW/p6SdSDm6RudRph6TaXnUsZZPwZW+z5+WrBDp92Osv1iUZ0TWCu0R6utscmdTpOXLGPmVvDPLWU9YEiZmg2XVBHk yC34V0AQ C5Ac3p9WdxMPNOW1JQy7t6SMVqs0VTDZg+e4SMhesv/QVrbuefjEAs3VviSfyKzQzKnqW57nMvSOjIfFK48hRt80Ga1KWW/zx/K44kU76W3TindhB6gwP7Ejhaq77xfaakJol9a99ptfwZRQTHU1KK8JrmVBwXUlkf0m4zfgXiCH7NRBci2Hw55pl328w8tYglKtsMG3aPtP7xLEYyTN1iuAlNQdm/G1PQKgHioETjTFCdjCyYNtZImJQDRyauw+5AzNy+HW5nxtHC+3oQmBNQKsknUPw4Jn9Mo2Hv2tt90s3nMPRngeleqmgBCN9tgtuJ8m+fwjLU02Kw5Xr9cYmVRt1IO5rXr0YrNxcuirz40y/kA8s56nAVzjUcGfa+T0N5C02nc/HKZMjyZ/LMmZbgp9DakVsgW+QaobhXrfaP1GuRfrqIV1xBIL6lTa+t9AgW0WMhWuyADS64THSHkrecLn1XXbvKwmHn1c8/eIgGiBb60w= 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: Chuck Lever --- net/sunrpc/svcsock.c | 7 ++----- net/sunrpc/xdr.c | 5 ++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 815baf308236a9..91252adcae4696 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -252,11 +252,8 @@ static ssize_t svc_tcp_read_msg(struct svc_rqst *rqstp, size_t buflen, clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); - for (i = 0, t = 0; t < buflen; i++, t += PAGE_SIZE) { - bvec[i].bv_page = rqstp->rq_pages[i]; - bvec[i].bv_len = PAGE_SIZE; - bvec[i].bv_offset = 0; - } + for (i = 0, t = 0; t < buflen; i++, t += PAGE_SIZE) + bvec_set_page(&bvec[i], rqstp->rq_pages[i], PAGE_SIZE, 0); rqstp->rq_respages = &rqstp->rq_pages[i]; rqstp->rq_next_page = rqstp->rq_respages + 1; diff --git a/net/sunrpc/xdr.c b/net/sunrpc/xdr.c index f7767bf224069f..afe7ec02d23229 100644 --- a/net/sunrpc/xdr.c +++ b/net/sunrpc/xdr.c @@ -150,9 +150,8 @@ xdr_alloc_bvec(struct xdr_buf *buf, gfp_t gfp) if (!buf->bvec) return -ENOMEM; for (i = 0; i < n; i++) { - buf->bvec[i].bv_page = buf->pages[i]; - buf->bvec[i].bv_len = PAGE_SIZE; - buf->bvec[i].bv_offset = 0; + bvec_set_page(&buf->bvec[i], buf->pages[i], PAGE_SIZE, + 0); } } return 0;