]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
exfat: rename argument name for exfat_move_file and exfat_rename_file
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Fri, 15 Nov 2024 01:43:10 +0000 (09:43 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 25 Nov 2024 08:08:21 +0000 (17:08 +0900)
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>
fs/exfat/namei.c

index 4b7308fae3d32c5f6eb85d88e2480eaec11d0c64..b0bf8c47dd5ea0b64cc83ac99c85df629debc627 100644 (file)
@@ -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);