From: Chi Zhiling <chizhiling@163.com>
To: "Yuezhang.Mo@sony.com" <Yuezhang.Mo@sony.com>,
Namjae Jeon <linkinjeon@kernel.org>,
Sungjong Seo <sj1557.seo@samsung.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Chi Zhiling <chizhiling@kylinos.cn>
Subject: Re: [PATCH v2 2/6] exfat: introduce exfat_fat_walk helper
Date: Fri, 3 Apr 2026 10:44:42 +0800 [thread overview]
Message-ID: <2b3e0290-c2ef-4d55-a7ae-cf5411de911a@163.com> (raw)
In-Reply-To: <PUZPR04MB6316BFAD68CF7BCCCAFFD4F5815EA@PUZPR04MB6316.apcprd04.prod.outlook.com>
On 4/3/26 10:34 AM, Yuezhang.Mo@sony.com wrote:
>> From: Chi Zhiling <chizhiling@kylinos.cn>
>>
>> Introduce exfat_fat_walk() to walk the FAT chain by a given step,
>> handling both ALLOC_NO_FAT_CHAIN and ALLOC_FAT_CHAIN modes. Also
>> redefine exfat_get_next_cluster as a thin wrapper around it for
>> backward compatibility.
>>
>> Signed-off-by: Chi Zhiling <chizhiling@kylinos.cn>
>> ---
>> fs/exfat/exfat_fs.h | 23 ++++++++++++++++++++++-
>> 1 file changed, 22 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
>> index 9fed9fb33cae..530459ab9acc 100644
>> --- a/fs/exfat/exfat_fs.h
>> +++ b/fs/exfat/exfat_fs.h
>> @@ -437,7 +437,8 @@ int exfat_set_volume_dirty(struct super_block *sb);
>> int exfat_clear_volume_dirty(struct super_block *sb);
>>
>> /* fatent.c */
>> -#define exfat_get_next_cluster(sb, pclu) exfat_ent_get(sb, *(pclu), pclu, NULL)
>> +#define exfat_get_next_cluster(sb, pclu) \
>> + exfat_fat_walk(sb, (pclu), 1, ALLOC_FAT_CHAIN)
>>
>> int exfat_alloc_cluster(struct inode *inode, unsigned int num_alloc,
>> struct exfat_chain *p_chain, bool sync_bmap);
>> @@ -456,6 +457,26 @@ int exfat_count_num_clusters(struct super_block *sb,
>> int exfat_blk_readahead(struct super_block *sb, sector_t sec,
>> sector_t *ra, blkcnt_t *ra_cnt, sector_t end);
>>
>> +static inline int
>> +exfat_fat_walk(struct super_block *sb, unsigned int *clu,
>> + unsigned int step, int flags)
>> +{
>> + struct buffer_head *bh = NULL;
>> +
>> + if (flags == ALLOC_NO_FAT_CHAIN) {
>> + (*clu) += step;
>> + return 0;
>> + }
>
> For ALLOC_NO_FAT_CHAIN, since the FAT region is not accessed, it would be
> better to use a more general function name, such as exfat_cluster_walk.
Okay,
>
>> +
>> + while (step--) {
>> + if (exfat_ent_get(sb, *clu, clu, &bh))
>> + return -EIO;
>> + }
>> + brelse(bh);
>> +
>> + return 0;
>> +}
>> +
>> /* balloc.c */
>> int exfat_load_bitmap(struct super_block *sb);
>> void exfat_free_bitmap(struct exfat_sb_info *sbi);
>> --
>> 2.43.0
>
>
>
next prev parent reply other threads:[~2026-04-03 2:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 7:11 [PATCH v2 0/6] exfat: unify FAT chain walking helpers Chi Zhiling
2026-04-01 7:11 ` [PATCH v2 1/6] exfat: fix incorrect directory checksum after rename to shorter name Chi Zhiling
2026-04-01 7:11 ` [PATCH v2 2/6] exfat: introduce exfat_fat_walk helper Chi Zhiling
2026-04-03 2:34 ` Yuezhang.Mo
2026-04-03 2:44 ` Chi Zhiling [this message]
2026-04-01 7:11 ` [PATCH v2 3/6] exfat: use exfat_fat_walk helper to simplify fat entry walking Chi Zhiling
2026-04-02 14:22 ` Sungjong Seo
2026-04-03 2:43 ` Chi Zhiling
2026-04-01 7:11 ` [PATCH v2 4/6] exfat: remove NULL cache pointer case in exfat_ent_get Chi Zhiling
2026-04-01 7:11 ` [PATCH v2 5/6] exfat: introduce exfat_chain_advance helper Chi Zhiling
2026-04-03 2:34 ` Yuezhang.Mo
2026-04-03 2:47 ` Chi Zhiling
2026-04-03 3:33 ` Yuezhang.Mo
2026-04-03 4:28 ` Chi Zhiling
2026-04-01 7:11 ` [PATCH v2 6/6] exfat: use " Chi Zhiling
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=2b3e0290-c2ef-4d55-a7ae-cf5411de911a@163.com \
--to=chizhiling@163.com \
--cc=Yuezhang.Mo@sony.com \
--cc=chizhiling@kylinos.cn \
--cc=linkinjeon@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sj1557.seo@samsung.com \
/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
all inboxes | Powered by JetHome®