Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Tetsuhiro Kohada <Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp>
Link: https://lore.kernel.org/r/20200217072941.34116-2-Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tetsuhiro Kohada and committed by
Greg Kroah-Hartman
23aa1034 fa4f4ce5

+5 -9
+1 -1
drivers/staging/exfat/exfat.h
··· 683 683 u32 type, 684 684 struct dentry_t **file_ep); 685 685 void release_entry_set(struct entry_set_cache_t *es); 686 - s32 count_entries(struct super_block *sb, struct chain_t *p_dir, u32 type); 686 + s32 count_dir_entries(struct super_block *sb, struct chain_t *p_dir); 687 687 void update_dir_checksum(struct super_block *sb, struct chain_t *p_dir, 688 688 s32 entry); 689 689 void update_dir_checksum_with_entry_set(struct super_block *sb,
+2 -6
drivers/staging/exfat/exfat_core.c
··· 1850 1850 return count; 1851 1851 } 1852 1852 1853 - s32 count_entries(struct super_block *sb, struct chain_t *p_dir, u32 type) 1853 + s32 count_dir_entries(struct super_block *sb, struct chain_t *p_dir) 1854 1854 { 1855 1855 int i, count = 0; 1856 1856 s32 dentries_per_clu; ··· 1881 1881 1882 1882 if (entry_type == TYPE_UNUSED) 1883 1883 return count; 1884 - if (!(type & TYPE_CRITICAL_PRI) && 1885 - !(type & TYPE_BENIGN_PRI)) 1886 - continue; 1887 - 1888 - if ((type == TYPE_ALL) || (type == entry_type)) 1884 + if (entry_type == TYPE_DIR) 1889 1885 count++; 1890 1886 } 1891 1887
+2 -2
drivers/staging/exfat/exfat_super.c
··· 1468 1468 p_fs->cluster_size_bits; 1469 1469 } 1470 1470 1471 - count = count_entries(sb, &dir, TYPE_DIR); 1471 + count = count_dir_entries(sb, &dir); 1472 1472 if (count < 0) { 1473 1473 ret = count; /* propagate error upward */ 1474 1474 goto out; ··· 1535 1535 info->Size = (u64)count_num_clusters(sb, &dir) << 1536 1536 p_fs->cluster_size_bits; 1537 1537 1538 - count = count_entries(sb, &dir, TYPE_DIR); 1538 + count = count_dir_entries(sb, &dir); 1539 1539 if (count < 0) { 1540 1540 ret = count; /* propagate error upward */ 1541 1541 goto out;