Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp566257rwb; Wed, 16 Nov 2022 04:55:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wmRU6coDElVeiMXZe5IJ3Loyq+TUsCuig3tRKYIPC7iUiddHiFJIPal4JcXHC8TN3+35R X-Received: by 2002:a17:906:68d2:b0:7ad:d051:538f with SMTP id y18-20020a17090668d200b007add051538fmr17971414ejr.401.1668603352098; Wed, 16 Nov 2022 04:55:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668603352; cv=none; d=google.com; s=arc-20160816; b=EjYRIpv/SlRwV47d4stWYB3/nnJcpKmOUhZxZnKKjYVbELao8cYvGupH73202kTfqp M76GJWEIOIpmlRSwOpWuVhQC3E3A1+UDMUQsEIKkBAD3s1ts2sbywPdSuA9b+vK5AjHN g30suFHNeNPbwm2gqocDKFZL1/An+AC2lUQ9yJFJI/yBb+E21qGjZnx6Jp6e18hqKGAk WoPrAejnoJ/usITPuqDnG1sDnbEU03SUZyZbZSVpC2MvqEKtYT795S2l6uzSeg2yPmVX ooHX+7hN/sRwWaVtVSiWkG8X1zStIG2kDZzDqsct2pdMLFKgwb4OstajYRqI61CGJBOl Jc1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Le7fUI8EByGsNv2RTRKDl6/FR7n56DVqXQ4LsOmmJ/U=; b=I2SdEpAdX2mPvAUo9bPtsVfaOXFs0AHlg7b6yVKlGTKPB6o6M8BHgwnd7sj+KLJ3VO kLOcbLJ5np9Z416pALHYzUpQPFni7zhjb7sySU4828Hb56gir7BSvHBDBIQe/X1SLoUM rQZSln9wrhyvGOhQ8bHnh7i26CgktLmEXUnSOtxpq24WY3ii6ctWjMoxV9KyuolCRHT6 0Yaocr2Wmr99Bj1Xad3IaPApNs8sLhv7MkXxeVSSJKxUsbuUQqQ0uwao60KkhysixYla 7nz123r8mbv0R5iA9kEZXf6+y4AID7IXChB+dCyYB2Au0nsb597+9B6D8W4AL1eIBkoT nvCw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a056402084500b0045b965cf1dasi15291034edz.175.2022.11.16.04.55.29; Wed, 16 Nov 2022 04:55:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238784AbiKPMUn (ORCPT + 91 others); Wed, 16 Nov 2022 07:20:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbiKPMTu (ORCPT ); Wed, 16 Nov 2022 07:19:50 -0500 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E89EFA46D; Wed, 16 Nov 2022 04:17:56 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VUxx6gz_1668601073; Received: from 30.221.128.213(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VUxx6gz_1668601073) by smtp.aliyun-inc.com; Wed, 16 Nov 2022 20:17:54 +0800 Message-ID: <68463af5-952b-a024-21fd-fa9e5fc37eb3@linux.alibaba.com> Date: Wed, 16 Nov 2022 20:17:53 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH v3 1/2] fscache,cachefiles: add prepare_ondemand_read() callback Content-Language: en-US To: Jeff Layton , xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, linux-cachefs@redhat.com, dhowells@redhat.com Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20221116104502.107431-1-jefflexu@linux.alibaba.com> <20221116104502.107431-2-jefflexu@linux.alibaba.com> <2b595b62f6ecd28298a860fcdc5b4941dcafd9eb.camel@kernel.org> From: Jingbo Xu In-Reply-To: <2b595b62f6ecd28298a860fcdc5b4941dcafd9eb.camel@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jeff, Thanks for the comment! On 11/16/22 7:58 PM, Jeff Layton wrote: >> >> -/* >> - * Prepare a read operation, shortening it to a cached/uncached >> - * boundary as appropriate. >> - */ >> -static enum netfs_io_source cachefiles_prepare_read(struct netfs_io_subrequest *subreq, >> - loff_t i_size) >> +static enum netfs_io_source cachefiles_do_prepare_read(struct netfs_cache_resources *cres, >> + loff_t *_start, size_t *_len, >> + unsigned long *_flags, loff_t i_size) > > _start is never changed, so it should be passed by value instead of by > pointer. Yeah, start is indeed unchanged, and I think it's also reasonable to pass it by value rather than by pointer. > I'd also reverse the position of the arguments for _flags and > i_size.  Otherwise, the CPU/compiler have to shuffle things around more > in cachefiles_prepare_ondemand_read before they call this. Yeah I didn't notice the details. I will fix the above two issues in a quick v4 version. Many thanks for the feedback. -- Thanks, Jingbo