[<prev] [next>] [day] [month] [year] [list]
Message-ID:
<PUZPR04MB6316194114D39A6505BA45A381BCA@PUZPR04MB6316.apcprd04.prod.outlook.com>
Date: Tue, 30 Dec 2025 09:06:16 +0000
From: "Yuezhang.Mo@...y.com" <Yuezhang.Mo@...y.com>
To: "chizhiling@....com" <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
> @@ -243,6 +244,7 @@ int exfat_get_cluster(struct inode *inode, unsigned int cluster,
> struct buffer_head *bh = NULL;
> struct exfat_cache_id cid;
> unsigned int content, fclus;
> + unsigned int end = (*count <= 1) ? cluster : cluster + *count - 1;
In exfat_get_block, count is set as follows:
count = EXFAT_B_TO_CLU_ROUND_UP(bh_result->b_size, sbi);
So '*count' is always greater than or equal to 1, the above condition seems unnecessary.
> --- a/fs/exfat/inode.c
> +++ b/fs/exfat/inode.c
> @@ -134,6 +134,7 @@ static int exfat_map_cluster(struct inode *inode, unsigned int clu_offset,
> struct exfat_inode_info *ei = EXFAT_I(inode);
> unsigned int local_clu_offset = clu_offset;
> unsigned int num_to_be_allocated = 0, num_clusters;
> + unsigned int hint_count = max(*count, 1);
Same as above, hint_count seems unnecessary.
> + /*
> + * 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.
> + 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?
Powered by blists - more mailing lists