Skip to content

Commit 72880cb

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: remove unnecessary arguments from exfat_find_dir_entry()
This commit removes argument 'num_entries' and 'type' from exfat_find_dir_entry(). 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 015c0d4 commit 72880cb

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

fs/exfat/dir.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ enum {
956956
*/
957957
int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
958958
struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
959-
int num_entries, unsigned int type, struct exfat_hint *hint_opt)
959+
struct exfat_hint *hint_opt)
960960
{
961961
int i, rewind = 0, dentry = 0, end_eidx = 0, num_ext = 0, len;
962962
int order, step, name_len = 0;
@@ -967,6 +967,10 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
967967
struct exfat_hint *hint_stat = &ei->hint_stat;
968968
struct exfat_hint_femp candi_empty;
969969
struct exfat_sb_info *sbi = EXFAT_SB(sb);
970+
int num_entries = exfat_calc_num_entries(p_uniname);
971+
972+
if (num_entries < 0)
973+
return num_entries;
970974

971975
dentries_per_clu = sbi->dentries_per_clu;
972976

@@ -1020,10 +1024,8 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
10201024
step = DIRENT_STEP_FILE;
10211025
hint_opt->clu = clu.dir;
10221026
hint_opt->eidx = i;
1023-
if (type == TYPE_ALL || type == entry_type) {
1024-
num_ext = ep->dentry.file.num_ext;
1025-
step = DIRENT_STEP_STRM;
1026-
}
1027+
num_ext = ep->dentry.file.num_ext;
1028+
step = DIRENT_STEP_STRM;
10271029
brelse(bh);
10281030
continue;
10291031
}

fs/exfat/exfat_fs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ enum {
7171
#define TYPE_PADDING 0x0402
7272
#define TYPE_ACLTAB 0x0403
7373
#define TYPE_BENIGN_SEC 0x0800
74-
#define TYPE_ALL 0x0FFF
7574

7675
#define MAX_CHARSET_SIZE 6 /* max size of multi-byte character */
7776
#define MAX_NAME_LENGTH 255 /* max len of file name excluding NULL */
@@ -490,7 +489,7 @@ void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es);
490489
int exfat_calc_num_entries(struct exfat_uni_name *p_uniname);
491490
int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
492491
struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
493-
int num_entries, unsigned int type, struct exfat_hint *hint_opt);
492+
struct exfat_hint *hint_opt);
494493
int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu);
495494
struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
496495
struct exfat_chain *p_dir, int entry, struct buffer_head **bh);

fs/exfat/namei.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static int exfat_create(struct user_namespace *mnt_userns, struct inode *dir,
597597
static int exfat_find(struct inode *dir, struct qstr *qname,
598598
struct exfat_dir_entry *info)
599599
{
600-
int ret, dentry, num_entries, count;
600+
int ret, dentry, count;
601601
struct exfat_chain cdir;
602602
struct exfat_uni_name uni_name;
603603
struct super_block *sb = dir->i_sb;
@@ -616,10 +616,6 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
616616
if (ret)
617617
return ret;
618618

619-
num_entries = exfat_calc_num_entries(&uni_name);
620-
if (num_entries < 0)
621-
return num_entries;
622-
623619
/* check the validation of hint_stat and initialize it if required */
624620
if (ei->version != (inode_peek_iversion_raw(dir) & 0xffffffff)) {
625621
ei->hint_stat.clu = cdir.dir;
@@ -629,9 +625,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
629625
}
630626

631627
/* search the file name for directories */
632-
dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name,
633-
num_entries, TYPE_ALL, &hint_opt);
634-
628+
dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name, &hint_opt);
635629
if (dentry < 0)
636630
return dentry; /* -error value */
637631

0 commit comments

Comments
 (0)