From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Jeff Layton <jlayton@kernel.org>,
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
Subject: Re: [PATCH v3 1/2] fscache,cachefiles: add prepare_ondemand_read() callback
Date: Wed, 16 Nov 2022 20:17:53 +0800 [thread overview]
Message-ID: <68463af5-952b-a024-21fd-fa9e5fc37eb3@linux.alibaba.com> (raw)
In-Reply-To: <2b595b62f6ecd28298a860fcdc5b4941dcafd9eb.camel@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
next prev parent reply other threads:[~2022-11-16 12:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 10:45 [PATCH v3 0/2] fscache,cachefiles: add prepare_ondemand_read() interface Jingbo Xu
2022-11-16 10:45 ` [PATCH v3 1/2] fscache,cachefiles: add prepare_ondemand_read() callback Jingbo Xu
2022-11-16 11:58 ` Jeff Layton
2022-11-16 12:17 ` Jingbo Xu [this message]
2022-11-16 13:41 ` David Howells
2022-11-17 4:24 ` Jingbo Xu
2022-11-16 10:45 ` [PATCH v3 2/2] erofs: switch to prepare_ondemand_read() in fscache mode Jingbo Xu
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=68463af5-952b-a024-21fd-fa9e5fc37eb3@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