exfat: remove unused functions
authorYuezhang Mo <Yuezhang.Mo@sony.com>
Fri, 5 Aug 2022 08:57:04 +0000 (16:57 +0800)
committerNamjae Jeon <linkinjeon@kernel.org>
Tue, 19 Mar 2024 11:56:01 +0000 (20:56 +0900)
exfat_count_ext_entries() is no longer called, remove it.
exfat_update_dir_chksum() is no longer called, remove it and
rename exfat_update_dir_chksum_with_entry_set() to it.

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/inode.c

index df39e24..077944d 100644 (file)
@@ -478,41 +478,6 @@ void exfat_init_dir_entry(struct exfat_entry_set_cache *es,
        exfat_init_stream_entry(ep, start_clu, size);
 }
 
-int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir,
-               int entry)
-{
-       struct super_block *sb = inode->i_sb;
-       int ret = 0;
-       int i, num_entries;
-       u16 chksum;
-       struct exfat_dentry *ep, *fep;
-       struct buffer_head *fbh, *bh;
-
-       fep = exfat_get_dentry(sb, p_dir, entry, &fbh);
-       if (!fep)
-               return -EIO;
-
-       num_entries = fep->dentry.file.num_ext + 1;
-       chksum = exfat_calc_chksum16(fep, DENTRY_SIZE, 0, CS_DIR_ENTRY);
-
-       for (i = 1; i < num_entries; i++) {
-               ep = exfat_get_dentry(sb, p_dir, entry + i, &bh);
-               if (!ep) {
-                       ret = -EIO;
-                       goto release_fbh;
-               }
-               chksum = exfat_calc_chksum16(ep, DENTRY_SIZE, chksum,
-                               CS_DEFAULT);
-               brelse(bh);
-       }
-
-       fep->dentry.file.checksum = cpu_to_le16(chksum);
-       exfat_update_bh(fbh, IS_DIRSYNC(inode));
-release_fbh:
-       brelse(fbh);
-       return ret;
-}
-
 static void exfat_free_benign_secondary_clusters(struct inode *inode,
                struct exfat_dentry *ep)
 {
@@ -552,7 +517,7 @@ void exfat_init_ext_entry(struct exfat_entry_set_cache *es, int num_entries,
                uniname += EXFAT_FILE_NAME_LEN;
        }
 
-       exfat_update_dir_chksum_with_entry_set(es);
+       exfat_update_dir_chksum(es);
 }
 
 void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es,
@@ -574,7 +539,7 @@ void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es,
                es->modified = true;
 }
 
-void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es)
+void exfat_update_dir_chksum(struct exfat_entry_set_cache *es)
 {
        int chksum_type = CS_DIR_ENTRY, i;
        unsigned short chksum = 0;
@@ -1241,27 +1206,6 @@ found:
        return dentry - num_ext;
 }
 
-int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir,
-               int entry, struct exfat_dentry *ep)
-{
-       int i, count = 0;
-       unsigned int type;
-       struct exfat_dentry *ext_ep;
-       struct buffer_head *bh;
-
-       for (i = 0, entry++; i < ep->dentry.file.num_ext; i++, entry++) {
-               ext_ep = exfat_get_dentry(sb, p_dir, entry, &bh);
-               if (!ext_ep)
-                       return -EIO;
-
-               type = exfat_get_entry_type(ext_ep);
-               brelse(bh);
-               if (type & TYPE_CRITICAL_SEC || type & TYPE_BENIGN_SEC)
-                       count++;
-       }
-       return count;
-}
-
 int exfat_count_dir_entries(struct super_block *sb, struct exfat_chain *p_dir)
 {
        int i, count = 0;
index 1cc9147..ecc5db9 100644 (file)
@@ -431,8 +431,6 @@ int exfat_ent_get(struct super_block *sb, unsigned int loc,
                unsigned int *content);
 int exfat_ent_set(struct super_block *sb, unsigned int loc,
                unsigned int content);
-int exfat_count_ext_entries(struct super_block *sb, struct exfat_chain *p_dir,
-               int entry, struct exfat_dentry *p_entry);
 int exfat_chain_cont_cluster(struct super_block *sb, unsigned int chain,
                unsigned int len);
 int exfat_zeroed_cluster(struct inode *dir, unsigned int clu);
@@ -487,9 +485,7 @@ void exfat_init_ext_entry(struct exfat_entry_set_cache *es, int num_entries,
                struct exfat_uni_name *p_uniname);
 void exfat_remove_entries(struct inode *inode, struct exfat_entry_set_cache *es,
                int order);
-int exfat_update_dir_chksum(struct inode *inode, struct exfat_chain *p_dir,
-               int entry);
-void exfat_update_dir_chksum_with_entry_set(struct exfat_entry_set_cache *es);
+void exfat_update_dir_chksum(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,
index 0687f95..dd894e5 100644 (file)
@@ -94,7 +94,7 @@ int __exfat_write_inode(struct inode *inode, int sync)
                ep2->dentry.stream.start_clu = EXFAT_FREE_CLUSTER;
        }
 
-       exfat_update_dir_chksum_with_entry_set(&es);
+       exfat_update_dir_chksum(&es);
        return exfat_put_dentry_set(&es, sync);
 }