Skip to content

Commit 06a2b0b

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: rename argument name for exfat_move_file and exfat_rename_file
In this exfat implementation, the relationship between inode and ei is ei=EXFAT_I(inode). However, in the arguments of exfat_move_file() and exfat_rename_file(), argument 'inode' indicates the parent directory, but argument 'ei' indicates the target file to be renamed. They do not have the above relationship, which is not friendly to code readers. So this commit renames 'inode' to 'parent_inode', making the argument name match its role. Signed-off-by: Yuezhang Mo <[email protected]> Reviewed-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 30ef0e0 commit 06a2b0b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

fs/exfat/namei.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -995,15 +995,15 @@ static int exfat_rmdir(struct inode *dir, struct dentry *dentry)
995995
return err;
996996
}
997997

998-
static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
998+
static int exfat_rename_file(struct inode *parent_inode, struct exfat_chain *p_dir,
999999
int oldentry, struct exfat_uni_name *p_uniname,
10001000
struct exfat_inode_info *ei)
10011001
{
10021002
int ret, num_new_entries;
10031003
struct exfat_dentry *epold, *epnew;
1004-
struct super_block *sb = inode->i_sb;
1004+
struct super_block *sb = parent_inode->i_sb;
10051005
struct exfat_entry_set_cache old_es, new_es;
1006-
int sync = IS_DIRSYNC(inode);
1006+
int sync = IS_DIRSYNC(parent_inode);
10071007

10081008
if (unlikely(exfat_forced_shutdown(sb)))
10091009
return -EIO;
@@ -1023,7 +1023,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
10231023
if (old_es.num_entries < num_new_entries) {
10241024
int newentry;
10251025

1026-
newentry = exfat_find_empty_entry(inode, p_dir, num_new_entries,
1026+
newentry = exfat_find_empty_entry(parent_inode, p_dir, num_new_entries,
10271027
&new_es);
10281028
if (newentry < 0) {
10291029
ret = newentry; /* -EIO or -ENOSPC */
@@ -1047,7 +1047,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
10471047
if (ret)
10481048
goto put_old_es;
10491049

1050-
exfat_remove_entries(inode, &old_es, ES_IDX_FILE);
1050+
exfat_remove_entries(parent_inode, &old_es, ES_IDX_FILE);
10511051
ei->dir = *p_dir;
10521052
ei->entry = newentry;
10531053
} else {
@@ -1056,7 +1056,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
10561056
ei->attr |= EXFAT_ATTR_ARCHIVE;
10571057
}
10581058

1059-
exfat_remove_entries(inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
1059+
exfat_remove_entries(parent_inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
10601060
exfat_init_ext_entry(&old_es, num_new_entries, p_uniname);
10611061
}
10621062
return exfat_put_dentry_set(&old_es, sync);
@@ -1066,13 +1066,13 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
10661066
return ret;
10671067
}
10681068

1069-
static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
1069+
static int exfat_move_file(struct inode *parent_inode, struct exfat_chain *p_olddir,
10701070
int oldentry, struct exfat_chain *p_newdir,
10711071
struct exfat_uni_name *p_uniname, struct exfat_inode_info *ei)
10721072
{
10731073
int ret, newentry, num_new_entries;
10741074
struct exfat_dentry *epmov, *epnew;
1075-
struct super_block *sb = inode->i_sb;
1075+
struct super_block *sb = parent_inode->i_sb;
10761076
struct exfat_entry_set_cache mov_es, new_es;
10771077

10781078
num_new_entries = exfat_calc_num_entries(p_uniname);
@@ -1084,7 +1084,7 @@ static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
10841084
if (ret)
10851085
return -EIO;
10861086

1087-
newentry = exfat_find_empty_entry(inode, p_newdir, num_new_entries,
1087+
newentry = exfat_find_empty_entry(parent_inode, p_newdir, num_new_entries,
10881088
&new_es);
10891089
if (newentry < 0) {
10901090
ret = newentry; /* -EIO or -ENOSPC */
@@ -1104,18 +1104,18 @@ static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
11041104
*epnew = *epmov;
11051105

11061106
exfat_init_ext_entry(&new_es, num_new_entries, p_uniname);
1107-
exfat_remove_entries(inode, &mov_es, ES_IDX_FILE);
1107+
exfat_remove_entries(parent_inode, &mov_es, ES_IDX_FILE);
11081108

11091109
exfat_chain_set(&ei->dir, p_newdir->dir, p_newdir->size,
11101110
p_newdir->flags);
11111111

11121112
ei->entry = newentry;
11131113

1114-
ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(inode));
1114+
ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(parent_inode));
11151115
if (ret)
11161116
goto put_mov_es;
11171117

1118-
return exfat_put_dentry_set(&mov_es, IS_DIRSYNC(inode));
1118+
return exfat_put_dentry_set(&mov_es, IS_DIRSYNC(parent_inode));
11191119

11201120
put_mov_es:
11211121
exfat_put_dentry_set(&mov_es, false);

0 commit comments

Comments
 (0)