[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251226094440.455563-5-chizhiling@163.com>
Date: Fri, 26 Dec 2025 17:44:35 +0800
From: Chi Zhiling <chizhiling@....com>
To: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Namjae Jeon <linkinjeon@...nel.org>,
Sungjong Seo <sj1557.seo@...sung.com>,
Yuezhang Mo <yuezhang.mo@...y.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
Jan Kara <jack@...e.cz>,
Matthew Wilcox <willy@...radead.org>,
Chi Zhiling <chizhiling@...inos.cn>
Subject: [PATCH v1 4/9] exfat: improve exfat_count_num_clusters
From: Chi Zhiling <chizhiling@...inos.cn>
Since exfat_ent_get support cache buffer head, let's apply it to
exfat_count_num_clusters.
Signed-off-by: Chi Zhiling <chizhiling@...inos.cn>
---
fs/exfat/fatent.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index 679688cfea01..f060eab2f2f2 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -484,6 +484,7 @@ int exfat_count_num_clusters(struct super_block *sb,
unsigned int i, count;
unsigned int clu;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
+ struct buffer_head *bh = NULL;
if (!p_chain->dir || p_chain->dir == EXFAT_EOF_CLUSTER) {
*ret_count = 0;
@@ -499,12 +500,13 @@ int exfat_count_num_clusters(struct super_block *sb,
count = 0;
for (i = EXFAT_FIRST_CLUSTER; i < sbi->num_clusters; i++) {
count++;
- if (exfat_ent_get(sb, clu, &clu, NULL))
+ if (exfat_ent_get(sb, clu, &clu, &bh))
return -EIO;
if (clu == EXFAT_EOF_CLUSTER)
break;
}
+ brelse(bh);
*ret_count = count;
/*
--
2.43.0
Powered by blists - more mailing lists