Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7648604rwb; Wed, 23 Nov 2022 09:02:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf6VUtqRWi8u8JllwuhNzIFeLWNwVv2olk1cCU454D8ewOmiXqqDVBE+f1pCOKDPeY+UTVGf X-Received: by 2002:a05:651c:200c:b0:279:3d7a:c240 with SMTP id s12-20020a05651c200c00b002793d7ac240mr6627083ljo.289.1669222961221; Wed, 23 Nov 2022 09:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669222961; cv=none; d=google.com; s=arc-20160816; b=tMriUocK7KlRmtoAYPpwE88Jc9/35rBqlFgrpi7sWwgVnoE5QJ38mKgF/ErTpUjOnN SJkUNAwxj0QDQTqhI+U2p8wlLiYYyp6FuZo3L6XaMN93zkr5NqO8wUO+DIU5pjo7VTQD qNEjQB2ARrTaecXE8vVAYe63Onnj2pNk94pppZ8SX1AOyI8m6Kh8HGG3YCle4tPixlrJ 7KNZx2OBSLglvaWp+YJcbqrffr7TMvkFKBOuymusNo3GK4YdYQeSGThZ4nlXcoWWE99q seDhSs4f3OhoeDDDIJd0ng1XsHEAs2k/dvgVJ28gJU1VfOq58k56HJJRj2dqpkdr4Aj7 h2uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=wmLo5b/TBcqyf/fyKj1XX69CJGukHZ7yEx4cmTraIL0=; b=DXCRxbhC89nFK54XUtmyQFTaqdPbnyyrwKyJkyBOecXRbn8Jnh27x6WQH8QbjLsVDX kBwtlWfOjsunnNVxxplnIPj+8nLI1Ez9nkcjE8McZMdSHta84mqO8UuDXdU5sp+KAVb0 dxL1OSNmR2u7Lq4fv6KGYlmaT8Bt+tNJl6RTO9gzj35Ksj9qfxFK9jcuyU/KJWNkbNbJ 8WKPv4vQibxlDUCXz0IOqjoiWl6MqAuHcC6InxY3XKyt8+7S2T687skPvUQo0wDrMk3L rcACuugUyoYd53PFG0ygvO4LhyCk65ibu18628NxJs9PgaihHx4+wo0fWgNbLaEwmfg5 dzQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a1ekT032; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv17-20020a17090760d100b0078dbd939dacsi14341677ejc.545.2022.11.23.09.02.13; Wed, 23 Nov 2022 09:02:41 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=a1ekT032; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239140AbiKWQpt (ORCPT + 88 others); Wed, 23 Nov 2022 11:45:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239079AbiKWQps (ORCPT ); Wed, 23 Nov 2022 11:45:48 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE15AC0514 for ; Wed, 23 Nov 2022 08:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669221889; 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=wmLo5b/TBcqyf/fyKj1XX69CJGukHZ7yEx4cmTraIL0=; b=a1ekT032rMJoePeoHE+lRVfWJYgfjOILMWzXNNG4xjEhf0z/NmKV0319Ynjlwx+oP8iPls d5RKyc2pa+HagQUSBI95wlB19l9vym2jNPQlJ3ep5xx1iznsZAWcNaJW7TQKW/U/XO0+l0 gZnNUWC01ZsNNb6pjkuFgM9Q8sCSgok= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-519-dIEnK4EDO6uePavw9I6IQg-1; Wed, 23 Nov 2022 11:44:47 -0500 X-MC-Unique: dIEnK4EDO6uePavw9I6IQg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 518EF1C2726A; Wed, 23 Nov 2022 16:44:47 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3311A1415114; Wed, 23 Nov 2022 16:44:46 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20221117053017.21074-2-jefflexu@linux.alibaba.com> References: <20221117053017.21074-2-jefflexu@linux.alibaba.com> <20221117053017.21074-1-jefflexu@linux.alibaba.com> To: Jingbo Xu Cc: dhowells@redhat.com, xiang@kernel.org, chao@kernel.org, jlayton@kernel.org, linux-erofs@lists.ozlabs.org, linux-cachefs@redhat.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 1/2] fscache,cachefiles: add prepare_ondemand_read() callback MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1609246.1669221883.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Wed, 23 Nov 2022 16:44:43 +0000 Message-ID: <1609247.1669221883@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Jingbo Xu 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_sub= request *subreq, > - loff_t i_size) > +static inline enum netfs_io_source > +cachefiles_do_prepare_read(struct netfs_cache_resources *cres, > + loff_t start, size_t *_len, loff_t i_size, > + unsigned long *_flags) That's not exactly what I meant, but I guess it would work as the compiler would probably inline it into both callers. > - __entry->netfs_inode, __entry->cache_inode) > + __entry->cache_inode) Can you not lose the netfs_inode number from the tracepoint, please? Feel free to display 0 there for your purposes. David