From patchwork Fri Feb 3 15:06:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13127858 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 987BAC64ED8 for ; Fri, 3 Feb 2023 15:08:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3E1276B0085; Fri, 3 Feb 2023 10:08:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 391CD6B0095; Fri, 3 Feb 2023 10:08:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20ADC6B0098; Fri, 3 Feb 2023 10:08:25 -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 0E1FC6B0085 for ; Fri, 3 Feb 2023 10:08:25 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id BEDFB41148 for ; Fri, 3 Feb 2023 15:08:24 +0000 (UTC) X-FDA: 80426311728.06.3942E52 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf16.hostedemail.com (Postfix) with ESMTP id 176BA180021 for ; Fri, 3 Feb 2023 15:08:22 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=ToEbOtDN; dmarc=none; spf=none (imf16.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675436903; 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=2wTw7HkUjs1o6mx8pDSLEqzVcH91B6qVA7sAnj3S4Po=; b=fIyk3qj251SrpDg6h2tlFb1y+JME9JhZ58M8n4xNb6UfxAJyorpQzs0kGiB5KR88flFJiL j8DshidS7ParHfNOAwBhKhXXX1EUOgT0sUa4wm+jlCW1NUPU87cLXxBAVaIJegWkPnE+ih nDTZU0dpT+pZQ2wlPk+KTtutNKg33wk= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=ToEbOtDN; dmarc=none; spf=none (imf16.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675436903; a=rsa-sha256; cv=none; b=3zkkbUXFAQ6qNuDxbi1wxDjXMg7qVW21MP62xCtCEkMW42yfKIruSK7MEgLhFv344Dm3IY aapY/WBQNtHWxAWO3ZbdYn8Ptuw6yTvU0Pxre110la2pvyrc6PsryX+k9rYHCOh7VkIElN oGZ+71GTq5KEwbZzODUynOzxH79mcu8= 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=2wTw7HkUjs1o6mx8pDSLEqzVcH91B6qVA7sAnj3S4Po=; b=ToEbOtDNdTBGoUgoMd3dVYIAK+ Vo+zqcrz8IVsOHzD2xIZFEL2t9Bn/hNiVbmh+YIKKRcvOn1ubj24IihBgJh2kM5KFu6iVtqtwpzxX oRD7Xo02sO7/WXeEh1Bq2VQyw4arZl+NOMyoR/R0jybBJwCkPEAv1fus8+GKr8vOV+/6nctIvAXQX v/8IR4b2+Vt8YkIC6hmjY723lH+FryD2Ya2pjiiKi55AuYTSdyGrkSc/nPY8GqU2dWmMb8VNRdmeA e6icfVpC02OEMu+KnxJRix9jzSPIf3CAvspcMVIb2QGK3zEHEfl6L8YRmlO1OSvmS6PInQuuEdJv8 BjFgLaZQ==; 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 1pNxfH-002bLQ-H0; Fri, 03 Feb 2023 15:07:48 +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 20/23] rxrpc: use bvec_set_page to initialize a bvec Date: Fri, 3 Feb 2023 16:06:31 +0100 Message-Id: <20230203150634.3199647-21-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-Rspamd-Queue-Id: 176BA180021 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: p3xwda7x737kcyradw68aexwnb4twfjn X-HE-Tag: 1675436902-665592 X-HE-Meta: U2FsdGVkX1/InOc59nYhPYwtwtprOFOR99Lkd0YPgkrieebhfG64Kk09kKYAgP+mbo8rVIK7TrNUHH0s0u7p7kXvRYSIC/yk2z9F1nFikOlOm5s/EjKIfkzdZC2q849Zy2Enq32lfN7heLujW3WTRn3smDNDJ03OzD7SZr++HOOBEH5P/9y0MOlJIUTRuHOKyH3Z55nBXxYxMvcWJG9ID9UcuNc5XB1kAlsPyQWRy6TJpyZAz0sMFWX9GD4iCn4uXFMm3JAjNpCCMxcY+1eWPKP4Iz8d150AkT/Lug9z9uWpuhhcqnCFipLP8O74fnGtNU4hxHHgb/ERNTGmnBRJ4MaoYF+Q2hxxvXVykDND1/Qd8EsGHo+sfrDobjT4JY0hbI5ym7iQVvG0/sUAoceaVFoG9QmZrJtvwkf7V3IS5FAihdNF1MSgQlxivAlvjjAhZgHsI6fn1HzFgY7ssvTjM2P7kB1EWJv7+QvWUe2gwiSTN0T2RscIpTEUXAXu3RB+6vAc4shN2x5GhoyzmhS+mFuDItXNpHfQqPwpejb8+ds7RhUHXFYkQOkW/LxViD+Yctm0PQfaen1Z7i183fbefkEUNTXzy5A0EnglbLvu2eoCbtgRgmtZya2s8lfi/uxDGJhGVkiuZZLFCIYgpdaHP+34A+vfL2YPOSThZjRHzkjw8YQMxTeVxiSphix4Miny3+a4z4ePLclXfVW4FsVJc0QfdnKIWRaOWmyQiLBQYm9Xd3ftyA1X57r5rDZ4rV0KvNqyUa43QX7GloeWwXFwCIbslSv/oVpOarB+BBN3OpTwaj/GHVuacsH061Kj6e4jr69rdOHfeXC79BOWy+uGuQPl3lgOgQ11RuFLfYP2kN+MSuKZupoZLdPST8FKcjPjORzO11BQWK+Fdn6xlYyD8mXHLOV5KALH/7Q0l+WP3ll7a/pxE938lMw/f25RaaId02zCTpgI2nnzkXlLS4g h20gS0b9 4MEbBCMHFirrOkQan+kTshBiWFs3+dDFA7LhqVHK1h4WiqUKI8lqzg73qRmvw3Ng8auOJggCoG79nUEsSNrPhdVaRTJNzUiCqwac1XL2vpVJ8sfZDMLgryPQT6hvk/1cgOxan3ZKurUsMW4+eovOQKwPnGU5Oryq/ypGSIAE5nGRLOqjcODMafiiZAkqKLSE6ZSLJzMExPcDz4YwHDR+4vpT9ECtzDpf5G+6g0txbb1kAxE4J1UCZiaOCk/yXEbdem7iZaNTvu5pa4m5xDonpqoenK+y4Qu5VG1p+0vGt+RWFC4mhM7mj+6PLa3GGLvI0YY+4oms3AvJ42p9P80PBM/cJhPLWmiAfeWaTG0qRCVpao55u7s8rez/plOvqvfKve8j2m/+n3Mpc1mTI9h8K4FYD0sMJggfaCJuJumC9dtgdTFyJ/iaL8cWb+gDNWRAA8usKJQMcL7d2UTZgUTZOQ4eH/F+/U1IpiSqWARhBe6ZwtRq04fJsEU5sIUkVA2C69ctP 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 a bvec. Signed-off-by: Christoph Hellwig Acked-by: David Howells --- net/rxrpc/rxperf.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net/rxrpc/rxperf.c b/net/rxrpc/rxperf.c index 16dcabb71ebe16..4a2e90015ca72c 100644 --- a/net/rxrpc/rxperf.c +++ b/net/rxrpc/rxperf.c @@ -493,7 +493,7 @@ static int rxperf_deliver_request(struct rxperf_call *call) static int rxperf_process_call(struct rxperf_call *call) { struct msghdr msg = {}; - struct bio_vec bv[1]; + struct bio_vec bv; struct kvec iov[1]; ssize_t n; size_t reply_len = call->reply_len, len; @@ -503,10 +503,8 @@ static int rxperf_process_call(struct rxperf_call *call) while (reply_len > 0) { len = min_t(size_t, reply_len, PAGE_SIZE); - bv[0].bv_page = ZERO_PAGE(0); - bv[0].bv_offset = 0; - bv[0].bv_len = len; - iov_iter_bvec(&msg.msg_iter, WRITE, bv, 1, len); + bvec_set_page(&bv, ZERO_PAGE(0), len, 0); + iov_iter_bvec(&msg.msg_iter, WRITE, &bv, 1, len); msg.msg_flags = MSG_MORE; n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg, len, rxperf_notify_end_reply_tx);