Skip to content

Commit 33a8666

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: remove argument 'p_dir' from exfat_add_entry()
The output of argument 'p_dir' of exfat_add_entry() is not used in either exfat_mkdir() or exfat_create(), remove the argument. Code refinement, no functional changes. Signed-off-by: Yuezhang Mo <[email protected]> Reviewed-by: Aoyama Wataru <[email protected]> Reviewed-by: Daniel Palmer <[email protected]> Reviewed-by: Sungjong Seo <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 0891c73 commit 33a8666

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

fs/exfat/namei.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,7 @@ static inline loff_t exfat_make_i_pos(struct exfat_dir_entry *info)
453453
}
454454

455455
static int exfat_add_entry(struct inode *inode, const char *path,
456-
struct exfat_chain *p_dir, unsigned int type,
457-
struct exfat_dir_entry *info)
456+
unsigned int type, struct exfat_dir_entry *info)
458457
{
459458
int ret, dentry, num_entries;
460459
struct super_block *sb = inode->i_sb;
@@ -477,7 +476,7 @@ static int exfat_add_entry(struct inode *inode, const char *path,
477476
}
478477

479478
/* exfat_find_empty_entry must be called before alloc_cluster() */
480-
dentry = exfat_find_empty_entry(inode, p_dir, num_entries, &es);
479+
dentry = exfat_find_empty_entry(inode, &info->dir, num_entries, &es);
481480
if (dentry < 0) {
482481
ret = dentry; /* -EIO or -ENOSPC */
483482
goto out;
@@ -504,7 +503,6 @@ static int exfat_add_entry(struct inode *inode, const char *path,
504503
if (ret)
505504
goto out;
506505

507-
info->dir = *p_dir;
508506
info->entry = dentry;
509507
info->flags = ALLOC_NO_FAT_CHAIN;
510508
info->type = type;
@@ -537,7 +535,6 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir,
537535
{
538536
struct super_block *sb = dir->i_sb;
539537
struct inode *inode;
540-
struct exfat_chain cdir;
541538
struct exfat_dir_entry info;
542539
loff_t i_pos;
543540
int err;
@@ -548,8 +545,7 @@ static int exfat_create(struct mnt_idmap *idmap, struct inode *dir,
548545

549546
mutex_lock(&EXFAT_SB(sb)->s_lock);
550547
exfat_set_volume_dirty(sb);
551-
err = exfat_add_entry(dir, dentry->d_name.name, &cdir, TYPE_FILE,
552-
&info);
548+
err = exfat_add_entry(dir, dentry->d_name.name, TYPE_FILE, &info);
553549
if (err)
554550
goto unlock;
555551

@@ -832,7 +828,6 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir,
832828
struct super_block *sb = dir->i_sb;
833829
struct inode *inode;
834830
struct exfat_dir_entry info;
835-
struct exfat_chain cdir;
836831
loff_t i_pos;
837832
int err;
838833
loff_t size = i_size_read(dir);
@@ -842,8 +837,7 @@ static int exfat_mkdir(struct mnt_idmap *idmap, struct inode *dir,
842837

843838
mutex_lock(&EXFAT_SB(sb)->s_lock);
844839
exfat_set_volume_dirty(sb);
845-
err = exfat_add_entry(dir, dentry->d_name.name, &cdir, TYPE_DIR,
846-
&info);
840+
err = exfat_add_entry(dir, dentry->d_name.name, TYPE_DIR, &info);
847841
if (err)
848842
goto unlock;
849843

0 commit comments

Comments
 (0)