]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
exfat: remove unnecessary arguments from exfat_find_dir_entry()
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Sun, 10 Apr 2022 08:12:14 +0000 (16:12 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Mon, 12 Dec 2022 02:02:50 +0000 (11:02 +0900)
This commit removes argument 'num_entries' and 'type' from
exfat_find_dir_entry().

Code refinement, no functional changes.

Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
fs/exfat/dir.c
fs/exfat/exfat_fs.h
fs/exfat/namei.c

index 397ea2d98848fff7e5e196d24e0e69c3742c816d..8121a7e073bc706564a5625c8f907723e5d3e5e4 100644 (file)
@@ -956,7 +956,7 @@ enum {
  */
 int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
                struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
-               int num_entries, unsigned int type, struct exfat_hint *hint_opt)
+               struct exfat_hint *hint_opt)
 {
        int i, rewind = 0, dentry = 0, end_eidx = 0, num_ext = 0, len;
        int order, step, name_len = 0;
@@ -967,6 +967,10 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
        struct exfat_hint *hint_stat = &ei->hint_stat;
        struct exfat_hint_femp candi_empty;
        struct exfat_sb_info *sbi = EXFAT_SB(sb);
+       int num_entries = exfat_calc_num_entries(p_uniname);
+
+       if (num_entries < 0)
+               return num_entries;
 
        dentries_per_clu = sbi->dentries_per_clu;
 
@@ -1020,10 +1024,8 @@ rewind:
                                step = DIRENT_STEP_FILE;
                                hint_opt->clu = clu.dir;
                                hint_opt->eidx = i;
-                               if (type == TYPE_ALL || type == entry_type) {
-                                       num_ext = ep->dentry.file.num_ext;
-                                       step = DIRENT_STEP_STRM;
-                               }
+                               num_ext = ep->dentry.file.num_ext;
+                               step = DIRENT_STEP_STRM;
                                brelse(bh);
                                continue;
                        }
index 37e8af8042aa901688bf65eeb3f2e67f706e2383..21fec01d68ff0fe870825c42ec5606080fa25242 100644 (file)
@@ -71,7 +71,6 @@ enum {
 #define TYPE_PADDING           0x0402
 #define TYPE_ACLTAB            0x0403
 #define TYPE_BENIGN_SEC                0x0800
-#define TYPE_ALL               0x0FFF
 
 #define MAX_CHARSET_SIZE       6 /* max size of multi-byte character */
 #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);
 int exfat_calc_num_entries(struct exfat_uni_name *p_uniname);
 int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
                struct exfat_chain *p_dir, struct exfat_uni_name *p_uniname,
-               int num_entries, unsigned int type, struct exfat_hint *hint_opt);
+               struct exfat_hint *hint_opt);
 int exfat_alloc_new_dir(struct inode *inode, struct exfat_chain *clu);
 struct exfat_dentry *exfat_get_dentry(struct super_block *sb,
                struct exfat_chain *p_dir, int entry, struct buffer_head **bh);
index 347c8df45bd00a0b680109dc437e9ed316e356f0..5f995eba5dbbe78c007400e1d9ed6e2fb66bdf2a 100644 (file)
@@ -597,7 +597,7 @@ unlock:
 static int exfat_find(struct inode *dir, struct qstr *qname,
                struct exfat_dir_entry *info)
 {
-       int ret, dentry, num_entries, count;
+       int ret, dentry, count;
        struct exfat_chain cdir;
        struct exfat_uni_name uni_name;
        struct super_block *sb = dir->i_sb;
@@ -616,10 +616,6 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
        if (ret)
                return ret;
 
-       num_entries = exfat_calc_num_entries(&uni_name);
-       if (num_entries < 0)
-               return num_entries;
-
        /* check the validation of hint_stat and initialize it if required */
        if (ei->version != (inode_peek_iversion_raw(dir) & 0xffffffff)) {
                ei->hint_stat.clu = cdir.dir;
@@ -629,9 +625,7 @@ static int exfat_find(struct inode *dir, struct qstr *qname,
        }
 
        /* search the file name for directories */
-       dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name,
-                       num_entries, TYPE_ALL, &hint_opt);
-
+       dentry = exfat_find_dir_entry(sb, ei, &cdir, &uni_name, &hint_opt);
        if (dentry < 0)
                return dentry; /* -error value */