linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: yuezhang.mo@foxmail.com
To: linkinjeon@kernel.org, sj1557.seo@samsung.com
Cc: linux-fsdevel@vger.kernel.org, Andy.Wu@sony.com,
	wataru.aoyama@sony.com, Yuezhang Mo <Yuezhang.Mo@sony.com>
Subject: [PATCH v1 09/11] exfat: remove unused functions
Date: Fri,  8 Dec 2023 19:23:18 +0800	[thread overview]
Message-ID: <tencent_B02EBA3CA542FA85A57F88CF08EC6A189C0A@qq.com> (raw)
In-Reply-To: <20231208112318.1135649-1-yuezhang.mo@foxmail.com>

From: Yuezhang Mo <Yuezhang.Mo@sony.com>

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>
---
 fs/exfat/dir.c      | 60 ++-------------------------------------------
 fs/exfat/exfat_fs.h |  6 +----
 fs/exfat/inode.c    |  2 +-
 3 files changed, 4 insertions(+), 64 deletions(-)

diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c
index 94cedc145291..c57a727d5285 100644
--- a/fs/exfat/dir.c
+++ b/fs/exfat/dir.c
@@ -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;
@@ -1237,27 +1202,6 @@ int exfat_find_dir_entry(struct super_block *sb, struct exfat_inode_info *ei,
 	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;
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h
index 0280a975586c..a2c70b3a27bd 100644
--- a/fs/exfat/exfat_fs.h
+++ b/fs/exfat/exfat_fs.h
@@ -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,
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 522edcbb2ce4..0614bccfbe76 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -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);
 }
 
-- 
2.25.1


  parent reply	other threads:[~2023-12-08 11:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231208112318.1135649-1-yuezhang.mo@foxmail.com>
2023-12-08 11:23 ` [PATCH v1 01/11] exfat: add __exfat_get_dentry_set() helper yuezhang.mo
2023-12-22  5:05   ` Namjae Jeon
2023-12-08 11:23 ` [PATCH v1 02/11] exfat: add exfat_get_empty_dentry_set() helper yuezhang.mo
2023-12-08 11:23 ` [PATCH v1 03/11] exfat: covert exfat_find_empty_entry() to use dentry cache yuezhang.mo
2023-12-08 11:23 ` [PATCH v1 04/11] exfat: covert exfat_add_entry() " yuezhang.mo
2023-12-08 11:23 ` [PATCH v1 05/11] exfat: covert exfat_remove_entries() " yuezhang.mo
2023-12-22  5:07   ` Namjae Jeon
2023-12-08 11:23 ` [PATCH v1 06/11] exfat: move free cluster out of exfat_init_ext_entry() yuezhang.mo
2023-12-08 11:23 ` [PATCH v1 07/11] exfat: covert exfat_init_ext_entry() to use dentry cache yuezhang.mo
2023-12-08 11:23 ` [PATCH v1 08/11] exfat: remove __exfat_find_empty_entry() yuezhang.mo
2023-12-22  5:07   ` Namjae Jeon
2023-12-08 11:23 ` yuezhang.mo [this message]
2023-12-08 11:23 ` [PATCH v1 10/11] exfat: do not sync parent dir if just update timestamp yuezhang.mo
2023-12-22  5:08   ` Namjae Jeon
2023-12-24 14:58     ` Yuezhang.Mo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_B02EBA3CA542FA85A57F88CF08EC6A189C0A@qq.com \
    --to=yuezhang.mo@foxmail.com \
    --cc=Andy.Wu@sony.com \
    --cc=Yuezhang.Mo@sony.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=wataru.aoyama@sony.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).