summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuezhang Mo <Yuezhang.Mo@sony.com>2024-11-15 09:43:10 +0800
committerNamjae Jeon <linkinjeon@kernel.org>2024-11-25 17:08:21 +0900
commit06a2b0b3b490a6103376652c01c3ac6e8e22e654 (patch)
tree7d02f85bfdb4590ce9bb492378217e046f494efe
parent30ef0e0d7ff5b6dceda19d18a85d9d72a4909784 (diff)
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 <Yuezhang.Mo@sony.com> Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
-rw-r--r--fs/exfat/namei.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index 4b7308fae3d3..b0bf8c47dd5e 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -995,15 +995,15 @@ unlock:
return err;
}
-static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
+static int exfat_rename_file(struct inode *parent_inode, struct exfat_chain *p_dir,
int oldentry, struct exfat_uni_name *p_uniname,
struct exfat_inode_info *ei)
{
int ret, num_new_entries;
struct exfat_dentry *epold, *epnew;
- struct super_block *sb = inode->i_sb;
+ struct super_block *sb = parent_inode->i_sb;
struct exfat_entry_set_cache old_es, new_es;
- int sync = IS_DIRSYNC(inode);
+ int sync = IS_DIRSYNC(parent_inode);
if (unlikely(exfat_forced_shutdown(sb)))
return -EIO;
@@ -1023,7 +1023,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
if (old_es.num_entries < num_new_entries) {
int newentry;
- newentry = exfat_find_empty_entry(inode, p_dir, num_new_entries,
+ newentry = exfat_find_empty_entry(parent_inode, p_dir, num_new_entries,
&new_es);
if (newentry < 0) {
ret = newentry; /* -EIO or -ENOSPC */
@@ -1047,7 +1047,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
if (ret)
goto put_old_es;
- exfat_remove_entries(inode, &old_es, ES_IDX_FILE);
+ exfat_remove_entries(parent_inode, &old_es, ES_IDX_FILE);
ei->dir = *p_dir;
ei->entry = newentry;
} else {
@@ -1056,7 +1056,7 @@ static int exfat_rename_file(struct inode *inode, struct exfat_chain *p_dir,
ei->attr |= EXFAT_ATTR_ARCHIVE;
}
- exfat_remove_entries(inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
+ exfat_remove_entries(parent_inode, &old_es, ES_IDX_FIRST_FILENAME + 1);
exfat_init_ext_entry(&old_es, num_new_entries, p_uniname);
}
return exfat_put_dentry_set(&old_es, sync);
@@ -1066,13 +1066,13 @@ put_old_es:
return ret;
}
-static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
+static int exfat_move_file(struct inode *parent_inode, struct exfat_chain *p_olddir,
int oldentry, struct exfat_chain *p_newdir,
struct exfat_uni_name *p_uniname, struct exfat_inode_info *ei)
{
int ret, newentry, num_new_entries;
struct exfat_dentry *epmov, *epnew;
- struct super_block *sb = inode->i_sb;
+ struct super_block *sb = parent_inode->i_sb;
struct exfat_entry_set_cache mov_es, new_es;
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,
if (ret)
return -EIO;
- newentry = exfat_find_empty_entry(inode, p_newdir, num_new_entries,
+ newentry = exfat_find_empty_entry(parent_inode, p_newdir, num_new_entries,
&new_es);
if (newentry < 0) {
ret = newentry; /* -EIO or -ENOSPC */
@@ -1104,18 +1104,18 @@ static int exfat_move_file(struct inode *inode, struct exfat_chain *p_olddir,
*epnew = *epmov;
exfat_init_ext_entry(&new_es, num_new_entries, p_uniname);
- exfat_remove_entries(inode, &mov_es, ES_IDX_FILE);
+ exfat_remove_entries(parent_inode, &mov_es, ES_IDX_FILE);
exfat_chain_set(&ei->dir, p_newdir->dir, p_newdir->size,
p_newdir->flags);
ei->entry = newentry;
- ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(inode));
+ ret = exfat_put_dentry_set(&new_es, IS_DIRSYNC(parent_inode));
if (ret)
goto put_mov_es;
- return exfat_put_dentry_set(&mov_es, IS_DIRSYNC(inode));
+ return exfat_put_dentry_set(&mov_es, IS_DIRSYNC(parent_inode));
put_mov_es:
exfat_put_dentry_set(&mov_es, false);