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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97074C64EC4 for ; Tue, 31 Jan 2023 01:52:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230453AbjAaBwP (ORCPT ); Mon, 30 Jan 2023 20:52:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbjAaBwM (ORCPT ); Mon, 30 Jan 2023 20:52:12 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE4A28D39 for ; Mon, 30 Jan 2023 17:51:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675129877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mBv8DJNmeWTzhqoixUePfk7DvfX/r91Bih49ZwlSTgg=; b=DC/74vslTzwnAVEO02wzUzKZO9FsmJQQvVyLu1aOUQQoIFRxiJB2pM3C6SSQ8ZwwTMh653 0dTn7zVksefp4LEZoq7HcTjcJ7Sgzcq3kwcZ1KyfZXMAdhSzPv2ZX+XPOqVvutfVgE/Fwd C6ReLcsooHyYBc0JuMNS1RmenAaSZwE= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-664-ps7QvK5fO2qo6v61NAjPPg-1; Mon, 30 Jan 2023 20:51:16 -0500 X-MC-Unique: ps7QvK5fO2qo6v61NAjPPg-1 Received: by mail-pf1-f198.google.com with SMTP id a18-20020a62bd12000000b0056e7b61ec78so6342572pff.17 for ; Mon, 30 Jan 2023 17:51:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mBv8DJNmeWTzhqoixUePfk7DvfX/r91Bih49ZwlSTgg=; b=BXpwt5EDe4QDcxxjFtMpZ/k3YH1xrmmV2RJpBkw3VUYgvfwSRSnBzBhL8G58PF4rLV Mmmori6ZR0gplLYJdFpaRWlh6PyJpISc4G8HFTdgjXS/x6B95jTl4YmsLYLAOa25o3DU qzklnRisUoAKPXyHze6b4julII1ua5PdbrDYRrjFGhdjqw3fZqO6DM+Q2+LkHtOGPIGh 6GX8x78mowMjvR2f4ZtwvHREtbBUYXIxYv1X1N8X2rp0ecwBFQu0YZkwdoOli/3RiITt 5vk8rR90IBnv+GCxBzMtne7ReH1ZBF5OKRYNG9yoc9GhCpdsaFJpemXsdiHunwOOgpWt rpXg== X-Gm-Message-State: AO0yUKVKA1mbjYo9WLaj6EdNXfemvvZ7z9mcWoW1i/gYoRnquMHTHKL5 Frjd6AWBuUoTWUev5vBozP9IhKyPBWI+RsgqC9Blm8FgD+9RWdEcoslTfWcugyLaH3xFO7kqKqb agbMnFLVZUDbaXhw5ORtN X-Received: by 2002:a17:902:d487:b0:196:15af:e6de with SMTP id c7-20020a170902d48700b0019615afe6demr29574986plg.68.1675129875397; Mon, 30 Jan 2023 17:51:15 -0800 (PST) X-Google-Smtp-Source: AK7set8JSjJ+sRvtPcXP6fVdufCYZ8fk74MG4aecVDj2Iej+5W2CdxzxrzRUj04G/QWJkYRImmyA4Q== X-Received: by 2002:a17:902:d487:b0:196:15af:e6de with SMTP id c7-20020a170902d48700b0019615afe6demr29574939plg.68.1675129875072; Mon, 30 Jan 2023 17:51:15 -0800 (PST) Received: from [10.72.13.217] ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id o17-20020a170902d4d100b00196077ba463sm8430985plg.123.2023.01.30.17.51.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Jan 2023 17:51:14 -0800 (PST) Message-ID: Date: Tue, 31 Jan 2023 09:51:00 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH 12/23] ceph: use bvec_set_page to initialize a bvec Content-Language: en-US To: Ilya Dryomov , Christoph Hellwig Cc: Jens Axboe , "Michael S. Tsirkin" , Jason Wang , Minchan Kim , Sergey Senozhatsky , Keith Busch , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" , David Howells , Marc Dionne , 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 References: <20230130092157.1759539-1-hch@lst.de> <20230130092157.1759539-13-hch@lst.de> From: Xiubo Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 31/01/2023 02:02, Ilya Dryomov wrote: > On Mon, Jan 30, 2023 at 10:22 AM Christoph Hellwig wrote: >> 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], > Hi Christoph, > > There is trailing whitespace on this line which git complains about > and it made me take a second look. I think bvec_set_page() allows to > make this more compact: > > for ( ; bytes; idx++, bvec_idx++) { > int len = min_t(int, bytes, PAGE_SIZE - start); > > bvec_set_page(&bvecs[bvec_idx], pages[idx], len, start); > bytes -= len; > start = 0; > } > This looks better. Thanks