From patchwork Mon Jan 30 09:21:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13120648 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 458C4C54EAA for ; Mon, 30 Jan 2023 09:25:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D5ED96B0080; Mon, 30 Jan 2023 04:25:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D0E286B0082; Mon, 30 Jan 2023 04:25:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAF676B0085; Mon, 30 Jan 2023 04:25:04 -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 A8B5C6B0080 for ; Mon, 30 Jan 2023 04:25:04 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 804811406B6 for ; Mon, 30 Jan 2023 09:25:04 +0000 (UTC) X-FDA: 80410931328.05.6117F35 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf13.hostedemail.com (Postfix) with ESMTP id D35F62000A for ; Mon, 30 Jan 2023 09:25:02 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xV25GZjM; spf=none (imf13.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=1675070702; 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=/tbj/Tg5whekQ1nWXF3p7MKn9zbAs7XJmrxsAI8qP60=; b=c0lSSa6hSPI5Db9qUOuNO1tBGxZ8Aut0gLVOi/WNaJ7V9wnWwN9ZQsvndNfqfGCCjLljGh 1d3VCzKi3GnP2PGCeioTiS2x70mNfPRqxM6EmxWpgTvLJcfVblJD0gW0yGA9BIfWanDP1t Fs/AeDPd4rFjKvGLBzhPuB5Sef1IjQM= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=xV25GZjM; spf=none (imf13.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=1675070702; a=rsa-sha256; cv=none; b=jIA1b9bgn96kZoX5Q62v+reIpdLgmleO1xJCrXl9D4Gz8npiJsQs5pJiZWkuKQ2hv7WifQ gOw7Y9O6wgKgJ8rD7271yT0V1OBsgmCmQuciIa/SvELhQAe/J318dKqXjbkrxCwzqqq7G2 jnDaHCgY/kfhWkh4OQ4wpIcrXFAYfR4= 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=/tbj/Tg5whekQ1nWXF3p7MKn9zbAs7XJmrxsAI8qP60=; b=xV25GZjMyWU+4JGmYdpveIpUhP MvUBg+0AGQ4cUbqnzgS5sBDTXnqtwa7wVQL/txup6BH72LNq11j+ASL+GP6Ibue6t7wZREu3rUD1l AbM+a9D4pvYCaOdcGlHWcEAPnUjRJfD7qL+Ec4haykBrsXqebtLBTfOzYEnuNsXcjCaaIrOmD+ztq 2JXHp7gUfawgcgXQeeYMy7wfb7NKSz3L9UdWz8jhsCHlQU1PdTMj+77eXPkBEtZwJbklE0+6NhWXJ sYARddyVpzWrCXb6bGEWE7jP7S97NALXNFekXFrTAc58YTwg3nKtsaWoeAg5DvHQiBSK7BtPBNU5S UhaRvYWw==; 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 1pMQN9-002oCh-OO; Mon, 30 Jan 2023 09:22:44 +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 12/23] ceph: use bvec_set_page to initialize a bvec Date: Mon, 30 Jan 2023 10:21:46 +0100 Message-Id: <20230130092157.1759539-13-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: D35F62000A X-Rspam-User: X-Stat-Signature: k7715qgpisdkhgm36pgbmfdxz68wyrub X-HE-Tag: 1675070702-105717 X-HE-Meta: U2FsdGVkX1+FxWrII5eAtTqRvpMdVx4wcMDgcotrNH5f91ZkVJ4dODRc7MvZ5rmjfjl6+s4+wh/X6f0o5esVaM0DppIucQc/ei18cFJJ29p+arQoc0X99vnIccNNc1kFizCnyT9YYHB3vof+OuK05qSwfbd2HkLldvXAoghU8dKz5CKG/qwHjvum28f6qhlhG0D9B14+s2pG1GTKhJCbty05ZOeOrOdDqqwO1JGdSSStvOLbEDICF6tUIn70bdoV2UaYqydfoK5uPDiY8M+vgKEZZC4Y+/kUxosB0ZgSoCWWl3ViuAM+EKzG1UtAQgSAWVQYZV5ZrWtOzEyjVPQn//eVlZ6+aEoHQGkZ5P8ZPfhkS3UjXcH8ANQrvZSJViRGNf23NAXSWePmhqLY6RcQb1c+IFTiJH4uPVgMgQ9teOV2B0kI7oxDwUSDWBdeJVVCorpEXgRUoicuMn9fhxhA1WrxEi756xNUD/my9omL6lgNK6ra1gz2E6muMX26rcSL8MC6YT4FrcN9sx8GcLloePai/KalQV6eQ5b9kskXOh79ZVHcveduIrIS+a12Kyoetv2oBd7PlYrYo7c5vU21IieFknBBvTR/KcA140stJg1lWUZ/R/5uyNHJO30LiiMb5zn35l82hRi3RjQon34Q9GamyGLkS7pYSo5Mown0bOG8V81j4zgKZLAuU9p3JnBaiqqU6QrQqcquv3S5dCgWcV+Jg6aRl2q/URgkiduboyn84FTr3Las47I+mHqDHm4x+o/Cy+g1fIZ7zC1AMRlGnQEFYw4eTX/u7y2Q1F81dLF3q+NqlbjKV5Bqn7xgzkXkf/A+199WQJFSjEWR2M7JKb4e3cKSC8MB7FJDjrT1bchYDZ4FyHvaFPZ3PGo64VxcgE+bdsYmYQM5gkoTMjZclGZpnGkujbRfHPsteLmwm9gpSwrAfsXlSWdtZSGIhlPozC0dn9wdj8MVdzAePJx 2NQq5k59 2j14vuAO8kY2lQ+AgGkAHEnCz/8h29dKtRcsbnyMRCQ+CjkRq/sQYwS9IF8AnQwGRzylIZCXYGc4U1fvO9BKLEwZYVQSSiM5o/by8KZGYc3vqR0TX/tm2rnEQ3lScfNnWpfIG5t4gNcxpUhIlCdMdlLEsIgtsznvpl+eAQBiK3eHydKatgvOpVtldPYrWapBavfLoCHZ9aX3Ja6mP4jEoq/dZ8tBEgMPqm3pT9GkjJmBUdWq46Zn5W0T/0FTWRKMP7n5SVokfIdQlCMdMkFmKj+/5iiuL/qCHRT8q4PhvEe1YSFu7EmGcXkyJpF1mOFb5abQm+stPALsAo/eGVY9Tpyuz+/5sdYzu8A6j5TjlRTaCpPzcz0l2K0bM1Nk/sofLh03IdRtH9AhADAISnT5WvG7C+2JCOlObDwQFtbxcPyxcm9/323U4L7lihnmCxDsTNEHcBJY2GO0WHrNPas+sCKs6CY5q0AvERfcr 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 --- fs/ceph/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 764598e1efd91f..6419dce7c57987 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -103,11 +103,11 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize, size += bytes; for ( ; bytes; idx++, bvec_idx++) { - struct bio_vec bv = { - .bv_page = pages[idx], - .bv_len = min_t(int, bytes, PAGE_SIZE - start), - .bv_offset = start, - }; + struct bio_vec bv; + + bvec_set_page(&bv, pages[idx], + min_t(int, bytes, PAGE_SIZE - start), + start); bvecs[bvec_idx] = bv; bytes -= bv.bv_len;