Commit 23aa1034 authored by Tetsuhiro Kohada's avatar Tetsuhiro Kohada Committed by Greg Kroah-Hartman

staging: exfat: dedicate count_entries() to sub-dir counting.

count_entries() function is only used to count sub-dirs.
Clarify the role and rename to count_dir_entries().
Signed-off-by: default avatarTetsuhiro Kohada <Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp>
Link: https://lore.kernel.org/r/20200217072941.34116-2-Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jpSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fa4f4ce5
...@@ -683,7 +683,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, ...@@ -683,7 +683,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb,
u32 type, u32 type,
struct dentry_t **file_ep); struct dentry_t **file_ep);
void release_entry_set(struct entry_set_cache_t *es); void release_entry_set(struct entry_set_cache_t *es);
s32 count_entries(struct super_block *sb, struct chain_t *p_dir, u32 type); s32 count_dir_entries(struct super_block *sb, struct chain_t *p_dir);
void update_dir_checksum(struct super_block *sb, struct chain_t *p_dir, void update_dir_checksum(struct super_block *sb, struct chain_t *p_dir,
s32 entry); s32 entry);
void update_dir_checksum_with_entry_set(struct super_block *sb, void update_dir_checksum_with_entry_set(struct super_block *sb,
......
...@@ -1850,7 +1850,7 @@ s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir, ...@@ -1850,7 +1850,7 @@ s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir,
return count; return count;
} }
s32 count_entries(struct super_block *sb, struct chain_t *p_dir, u32 type) s32 count_dir_entries(struct super_block *sb, struct chain_t *p_dir)
{ {
int i, count = 0; int i, count = 0;
s32 dentries_per_clu; s32 dentries_per_clu;
...@@ -1881,11 +1881,7 @@ s32 count_entries(struct super_block *sb, struct chain_t *p_dir, u32 type) ...@@ -1881,11 +1881,7 @@ s32 count_entries(struct super_block *sb, struct chain_t *p_dir, u32 type)
if (entry_type == TYPE_UNUSED) if (entry_type == TYPE_UNUSED)
return count; return count;
if (!(type & TYPE_CRITICAL_PRI) && if (entry_type == TYPE_DIR)
!(type & TYPE_BENIGN_PRI))
continue;
if ((type == TYPE_ALL) || (type == entry_type))
count++; count++;
} }
......
...@@ -1468,7 +1468,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1468,7 +1468,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info)
p_fs->cluster_size_bits; p_fs->cluster_size_bits;
} }
count = count_entries(sb, &dir, TYPE_DIR); count = count_dir_entries(sb, &dir);
if (count < 0) { if (count < 0) {
ret = count; /* propagate error upward */ ret = count; /* propagate error upward */
goto out; goto out;
...@@ -1535,7 +1535,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info) ...@@ -1535,7 +1535,7 @@ static int ffsReadStat(struct inode *inode, struct dir_entry_t *info)
info->Size = (u64)count_num_clusters(sb, &dir) << info->Size = (u64)count_num_clusters(sb, &dir) <<
p_fs->cluster_size_bits; p_fs->cluster_size_bits;
count = count_entries(sb, &dir, TYPE_DIR); count = count_dir_entries(sb, &dir);
if (count < 0) { if (count < 0) {
ret = count; /* propagate error upward */ ret = count; /* propagate error upward */
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment