public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: David Howells <dhowells@redhat.com>
Cc: 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
Date: Thu, 24 Nov 2022 11:19:50 +0800	[thread overview]
Message-ID: <25cfb176-ff2d-36e5-d12e-a2413ad2d5c2@linux.alibaba.com> (raw)
In-Reply-To: <1609247.1669221883@warthog.procyon.org.uk>

Hi David,

Really thanks for the comment.

On 11/24/22 12:44 AM, David Howells wrote:
> Jingbo Xu <jefflexu@linux.alibaba.com> 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 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.

Yeah, I just have no better way if we don't want another function
calling introduced by this patch.  If we keep cachefiles_prepare_read()
untouched, the on-demand users need to construct a temporary subrequest
on the stack, and Jeff pointed out that this way is somewhat fragile and
not robust enough.

Anyway I would keep moving forward in the direction of current patch,
and add back the netfs_inode number to the tracepoint.  I would send v5
soon.

Thanks again for the reply :-)

> 
>> -		      __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.
> 

Sure.


-- 
Thanks,
Jingbo

  reply	other threads:[~2022-11-24  3:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  5:30 [PATCH v4 0/2] fscache,cachefiles: add prepare_ondemand_read() interface Jingbo Xu
2022-11-17  5:30 ` [PATCH v4 1/2] fscache,cachefiles: add prepare_ondemand_read() callback Jingbo Xu
2022-11-17 11:05   ` Jeff Layton
2022-11-23  3:29   ` [Linux-cachefs] [PATCH v4 1/2] fscache, cachefiles: " Jingbo Xu
2022-11-23 16:44   ` [PATCH v4 1/2] fscache,cachefiles: " David Howells
2022-11-24  3:19     ` Jingbo Xu [this message]
2022-11-17  5:30 ` [PATCH v4 2/2] erofs: switch to prepare_ondemand_read() in fscache mode Jingbo Xu
2022-11-19  0:42   ` Gao Xiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=25cfb176-ff2d-36e5-d12e-a2413ad2d5c2@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-cachefs@redhat.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox