From patchwork Mon Jan 30 09:21:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120649 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 12F52C636CC for ; Mon, 30 Jan 2023 09:25:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CFDB6B0075; Mon, 30 Jan 2023 04:25:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 609B56B007D; Mon, 30 Jan 2023 04:25:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D1B26B0082; Mon, 30 Jan 2023 04:25:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 3CDCD6B0075 for ; Mon, 30 Jan 2023 04:25:05 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 265061A047B for ; Mon, 30 Jan 2023 09:25:05 +0000 (UTC) X-FDA: 80410931370.30.4B210A1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf07.hostedemail.com (Postfix) with ESMTP id 8506E40016 for ; Mon, 30 Jan 2023 09:25:03 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=TGW1NtTw; spf=none (imf07.hostedemail.com: domain of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) 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=1675070703; 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=0OKWMBRutlSAGY543ff9AUr9eECMFxK84Mqoa+H011w=; b=CjCuzEoIBOoP7rUTxHWw3CFU+eVxR3cgggGbweeKYoHdg3BboXQgt5WqdEBwP1awAfmjEE hoqjhP11QNW2uig7XVtCUZh/kcOVlt3cq6vx/u8VKwK0mFy1p+va/w653lToboHP39DeCK hQ7JBftZ72RDezwIcsERCt1wgZiurGk= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=TGW1NtTw; spf=none (imf07.hostedemail.com: domain of BATV+3ca177389f0c7d0d5156+7099+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) 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=1675070703; a=rsa-sha256; cv=none; b=RiKHFIpfiLY3f5CJb7kFek+WkOa2Zqm3SetNmz/vbMS4cRSJgKLHllejPEHi9JIkkY60gb H/bMF25zBZqjRN3TNzEPupl+HE07XhKhQ+U7eAwmhhYJIVpHOi7gxjgSIyO3Or/NWMiFsB hgpDW7i512K4cGaHimGmRun4BTiD09s= 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=0OKWMBRutlSAGY543ff9AUr9eECMFxK84Mqoa+H011w=; b=TGW1NtTwMqIanaIKWqoOD1aWmB n/scJWrL64fK9k4OmvwoP0vaCMaQaJe9Y+VWY3W+oBkV4Zz5KRTgvvNzhTLAybTpNMypmc86NpWuW A6DJic9z1tz1F4S9KHSq9PGe7EQLxke9ZXXIQgiJFf/NHyDM8LsAsGYTs8K1VSljQIgpxA6Q8vcN+ gkxoIqC9mz7btGrNG99XQEzTqkFz5So1CSl68dtRz5SSJVkhT79kCZOQhxXhh4kdvmuik+6cQ/s3J VzbxJG4gwIVB1atsV9i4jRnuqB9m3/Merfm1mu0MlDBtg87/cIKBrDvFskOHTF/k9hYJjdm93ZoXU OJuPg8Fw==; 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 1pMQNd-002oNl-Oa; Mon, 30 Jan 2023 09:23:15 +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: Mon, 30 Jan 2023 10:21:54 +0100 Message-Id: <20230130092157.1759539-21-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: 8506E40016 X-Rspam-User: X-Stat-Signature: w4pniaoy5mq1qtinquhs3tq1zcy7crif X-HE-Tag: 1675070703-532231 X-HE-Meta: U2FsdGVkX1+vuRzQx7/d5Om8zWTdTNWbJ6KsN93ZRHWeKzW5/sY5Szk3Ttr0qKjIdehOUpWD6bYDnZr13UqP+kxPT4HjMHCoVFld0dp7BVgXD6Tx7VA6iZbvCyCmejjQRCeL1ySoP+L1GTGrShFHNzCPAywsf3ujiQch7NuyCSYK1NvdESsXvFxys8VCjkqdsFNIDAU4duXGz4LYOCeSjnyRbKTIyv9D0hAR1etShbuzovUgqi4pW9FbtjN9HS0l46PA0FoWumeeeH+pbYBCTpNE4xXqdnaqItTNAKXbhFi+GYEQIw4bwhqZh7h+xofHSoYkumzIKNpweO9AUcKvlDA2au8DCzh+BVYm3klsFABhUEZruTl/ZToxgEefzQrWSfztU/I0cNkh+UU40CYIV67JIqlmbZjfm64wSzHAElZSwfAWNWuN/sCSx1C2+/LleaOLdwqCmrMQggUcz61o3sM0HT47R3QsYr9AfpyAtSVIJ7Uh/3p/174L5AcHMcJCBDIJ7TEaoIxC+SBzh+Hj2bm5FREPilgkfFs3+OUfZ7BPyWbkgmzdisyNPbKs1VdWRvdY4cW7CQX8PsE+cJSJwwT3ZF6liCuI7Ngz9uj/FrRAbGrEVhOtszZ7ttNcoTcxSijmnETZB7kH7ZN0B4sjNww7WpiPqXosseNVyq/MnlWvUVtaBav6YM8fGkD1Rh9VmXFiRxcui7PujYmlC7t72wi9/cFItF3XWwxN6saUyqdkhBqMdTihol7n0RrOsbxBi8ICMsurY6GAopeWB+9xOfNy3JDR7jffr9qvD2/vBITcFWxR2F6atNYTzwldSsjs40fRsqJ2a2lh2x/8CBnPXKcCN6D8ub8Kk5+BpEeGhdyOb0C78RkJIt3Zp1Zubo2NCV/xIr9zbya/bUAOX9eDOCxGcg3938aRpAqkSGAbC0JrCZphYviAE8BBxhaeMorI1W7UdfbjHfUupaXa6j0 jj217m+w 60vz7TZCY1PklyNo0xhLKCsE9xiqPRvpa+NVMZdgD9hFhLGfVDWm3RpwLlMPTTTMy/Hv56ceuLkeHsVOqHznKMMXuA5sBTlzJy/YbhMRmi69nH6zbj4xQzghAnBtZXhsM9ypb/Jt0h63bHtFsL3t1AcBHg7quM6T7wGp8okvWl9fBwJJUEAkJLa5o/gFS22xIHHp8SiDdSn1i/yQZ4AI/Xxd4lx3vga/sCnr25v0yETei9vV9s5UKnK8BPLWy6WcJGXJxGXJzctWIDNCwJ60Dmzgt47QaGEb4hsgODQHMuRDKQMGqjB3WDOOl5fmcezCqUaQSDHzQfhhW6p65d5Wf/2APGh3WzVumOPRCeVWaoNkVtJCXOO78PEUUo3AgsIzK96ub62efCS+nqOoWlJT7t8U8S8IpVC4bU4ktxIuC1ZsoCR6FWhDo399DIX8UCT9X99bIO9NKLWuoShKHPJTaWCbR7SeNNJ6fmeg/ 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);