[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68463af5-952b-a024-21fd-fa9e5fc37eb3@linux.alibaba.com>
Date: Wed, 16 Nov 2022 20:17:53 +0800
From: Jingbo Xu <jefflexu@...ux.alibaba.com>
To: Jeff Layton <jlayton@...nel.org>, xiang@...nel.org,
chao@...nel.org, linux-erofs@...ts.ozlabs.org,
linux-cachefs@...hat.com, dhowells@...hat.com
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v3 1/2] fscache,cachefiles: add prepare_ondemand_read()
callback
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
Powered by blists - more mailing lists