Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 4e1aa22

Browse files
YuezhangMonamjaejeon
authored andcommitted
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 <[email protected]> Reviewed-by: Andy Wu <[email protected]> Reviewed-by: Aoyama Wataru <[email protected]> Reviewed-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent ff4343d commit 4e1aa22

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

fs/exfat/dir.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -564,9 +564,6 @@ int exfat_init_ext_entry(struct inode *inode, struct exfat_chain *p_dir,
564564
if (!ep)
565565
return -EIO;
566566

567-
if (exfat_get_entry_type(ep) & TYPE_BENIGN_SEC)
568-
exfat_free_benign_secondary_clusters(inode, ep);
569-
570567
exfat_init_name_entry(ep, uniname);
571568
exfat_update_bh(bh, sync);
572569
brelse(bh);

fs/exfat/namei.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,12 +1082,13 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
10821082
epold->dentry.file.attr |= cpu_to_le16(EXFAT_ATTR_ARCHIVE);
10831083
ei->attr |= EXFAT_ATTR_ARCHIVE;
10841084
}
1085+
1086+
exfat_remove_entries(inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
1087+
10851088
ret = exfat_init_ext_entry(inode, p_dir, oldentry,
10861089
num_new_entries, p_uniname);
10871090
if (ret)
10881091
goto put_old_es;
1089-
1090-
exfat_remove_entries(inode, &old_es, num_new_entries);
10911092
}
10921093
return exfat_put_dentry_set(&old_es, sync);
10931094

0 commit comments

Comments
 (0)