aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/exfat/namei.c
diff options
context:
space:
mode:
authorYuezhang Mo <Yuezhang.Mo@sony.com>2023-02-01 18:53:18 +0800
committerNamjae Jeon <linkinjeon@kernel.org>2024-03-19 20:55:45 +0900
commit4e1aa22fea106014397455506d1383d519c4d3d1 (patch)
treeb48508b3ad6ee3bbc96b01d94ac2e9ed5ba828f8 /fs/exfat/namei.c
parentexfat: convert exfat_remove_entries() to use dentry cache (diff)
downloadwireguard-linux-4e1aa22fea106014397455506d1383d519c4d3d1.tar.xz
wireguard-linux-4e1aa22fea106014397455506d1383d519c4d3d1.zip
exfat: move free cluster out of exfat_init_ext_entry()
exfat_init_ext_entry() is an init function, it's a bit strange to free cluster in it. And the argument 'inode' will be removed from exfat_init_ext_entry(). So this commit changes to free the cluster in exfat_remove_entries(). Code refinement, no functional changes. Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Reviewed-by: Andy Wu <Andy.Wu@sony.com> Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com> Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to '')
-rw-r--r--fs/exfat/namei.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index f56e223b9b8f..be6760297e8f 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -1082,12 +1082,13 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
epold->dentry.file.attr |= cpu_to_le16(EXFAT_ATTR_ARCHIVE);
ei->attr |= EXFAT_ATTR_ARCHIVE;
}
+
+ exfat_remove_entries(inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
+
ret = exfat_init_ext_entry(inode, p_dir, oldentry,
num_new_entries, p_uniname);
if (ret)
goto put_old_es;
-
- exfat_remove_entries(inode, &old_es, num_new_entries);
}
return exfat_put_dentry_set(&old_es, sync);