[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<PUZPR04MB631627BD83F409B370337E4D81B9A@PUZPR04MB6316.apcprd04.prod.outlook.com>
Date: Sun, 4 Jan 2026 07:56:22 +0000
From: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>
To: Chi Zhiling <chizhiling@....com>
CC: "brauner@...nel.org" <brauner@...nel.org>,
"chizhiling@...inos.cn"
<chizhiling@...inos.cn>,
"jack@...e.cz" <jack@...e.cz>,
"linkinjeon@...nel.org" <linkinjeon@...nel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"sj1557.seo@...sung.com" <sj1557.seo@...sung.com>,
"viro@...iv.linux.org.uk"
<viro@...iv.linux.org.uk>,
"willy@...radead.org" <willy@...radead.org>
Subject: Re: [PATCH v1 9/9] exfat: support multi-cluster for exfat_get_cluster
> On 12/30/25 17:06, Yuezhang.Mo@...y.com wrote:
>>> + /*
>>> + * Return on cache hit to keep the code simple.
>>> + */
>>> + if (fclus == cluster) {
>>> + *count = cid.fcluster + cid.nr_contig - fclus + 1;
>>> return 0;
>>
>> If 'cid.fcluster + cid.nr_contig - fclus + 1 < *count', how about continuing to collect clusters?
>> The following clusters may be continuous.
>
> I'm glad you noticed this detail. It is necessary to explain this and
> update it in the code comments.
>
> The main reason why I didn't continue the collection was that the
> subsequent clusters might also exist in the cache. This requires us to
> search the cache again to confirm this, and this action might introduce
> additional performance overhead.
>
> I think we can continue to collect, but we need to check the cache
> before doing so.
>
So we also need to check the cache in the following, right?
```
/*
* Collect the remaining clusters of this contiguous extent.
*/
if (*dclus != EXFAT_EOF_CLUSTER) {
unsigned int clu = *dclus;
/*
* Now the cid cache contains the first cluster requested,
* Advance the fclus to the last cluster of contiguous
* extent, then update the count and cid cache accordingly.
*/
while (fclus < end) {
if (exfat_ent_get(sb, clu, &content, &bh))
goto err;
if (++clu != content) {
/* TODO: read ahead if content valid */
break;
}
fclus++;
}
cid.nr_contig = fclus - cid.fcluster;
*count = fclus - cluster + 1;
```
>>>
>>> + while (fclus < end) {
>>> + if (exfat_ent_get(sb, clu, &content, &bh))
>>> + goto err;
>>> + if (++clu != content) {
>>> + /* TODO: read ahead if content valid */
>>> + break;
>>
>> The next cluster index has been read and will definitely be used.
>> How about add it to the cache?
>
> Good idea!
> will add it in v2,
Powered by blists - more mailing lists