Commit 19e2bfe6 authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

staging: exfat: Clean up the namespace pollution part 1

Everything referenced in the struct fs_func exfat_fs_func is located
in that same .c file.  Make them static and remove from exfat.h
Signed-off-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191112211238.156490-6-Valdis.Kletnieks@vt.eduSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 35a829c1
...@@ -759,13 +759,8 @@ void fs_error(struct super_block *sb); ...@@ -759,13 +759,8 @@ void fs_error(struct super_block *sb);
/* cluster management functions */ /* cluster management functions */
s32 clear_cluster(struct super_block *sb, u32 clu); s32 clear_cluster(struct super_block *sb, u32 clu);
s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
struct chain_t *p_chain);
void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain,
s32 do_relse);
u32 find_last_cluster(struct super_block *sb, struct chain_t *p_chain); u32 find_last_cluster(struct super_block *sb, struct chain_t *p_chain);
s32 count_num_clusters(struct super_block *sb, struct chain_t *dir); s32 count_num_clusters(struct super_block *sb, struct chain_t *dir);
s32 exfat_count_used_clusters(struct super_block *sb);
void exfat_chain_cont_cluster(struct super_block *sb, u32 chain, s32 len); void exfat_chain_cont_cluster(struct super_block *sb, u32 chain, s32 len);
/* allocation bitmap management functions */ /* allocation bitmap management functions */
...@@ -781,29 +776,11 @@ s32 load_upcase_table(struct super_block *sb); ...@@ -781,29 +776,11 @@ s32 load_upcase_table(struct super_block *sb);
void free_upcase_table(struct super_block *sb); void free_upcase_table(struct super_block *sb);
/* dir entry management functions */ /* dir entry management functions */
u32 exfat_get_entry_type(struct dentry_t *p_entry);
void exfat_set_entry_type(struct dentry_t *p_entry, u32 type);
u32 exfat_get_entry_attr(struct dentry_t *p_entry);
void exfat_set_entry_attr(struct dentry_t *p_entry, u32 attr);
u8 exfat_get_entry_flag(struct dentry_t *p_entry);
void exfat_set_entry_flag(struct dentry_t *p_entry, u8 flag);
u32 exfat_get_entry_clu0(struct dentry_t *p_entry);
void exfat_set_entry_clu0(struct dentry_t *p_entry, u32 start_clu);
u64 exfat_get_entry_size(struct dentry_t *p_entry);
void exfat_set_entry_size(struct dentry_t *p_entry, u64 size);
struct timestamp_t *tm_current(struct timestamp_t *tm); struct timestamp_t *tm_current(struct timestamp_t *tm);
void exfat_get_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
u8 mode);
void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
u8 mode);
s32 exfat_init_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, u32 type, u32 start_clu, u64 size);
void init_file_entry(struct file_dentry_t *ep, u32 type); void init_file_entry(struct file_dentry_t *ep, u32 type);
void init_strm_entry(struct strm_dentry_t *ep, u8 flags, u32 start_clu, void init_strm_entry(struct strm_dentry_t *ep, u8 flags, u32 start_clu,
u64 size); u64 size);
void init_name_entry(struct name_dentry_t *ep, u16 *uniname); void init_name_entry(struct name_dentry_t *ep, u16 *uniname);
void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, s32 order, s32 num_entries);
s32 find_location(struct super_block *sb, struct chain_t *p_dir, s32 entry, s32 find_location(struct super_block *sb, struct chain_t *p_dir, s32 entry,
sector_t *sector, s32 *offset); sector_t *sector, s32 *offset);
...@@ -822,11 +799,6 @@ s32 search_deleted_or_unused_entry(struct super_block *sb, ...@@ -822,11 +799,6 @@ s32 search_deleted_or_unused_entry(struct super_block *sb,
struct chain_t *p_dir, s32 num_entries); struct chain_t *p_dir, s32 num_entries);
s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir,
s32 num_entries); s32 num_entries);
s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir,
struct uni_name_t *p_uniname, s32 num_entries,
struct dos_name_t *p_dosname, u32 type);
s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir,
s32 entry, struct dentry_t *p_entry);
s32 count_dos_name_entries(struct super_block *sb, struct chain_t *p_dir, s32 count_dos_name_entries(struct super_block *sb, struct chain_t *p_dir,
u32 type); u32 type);
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,
...@@ -839,12 +811,8 @@ bool is_dir_empty(struct super_block *sb, struct chain_t *p_dir); ...@@ -839,12 +811,8 @@ bool is_dir_empty(struct super_block *sb, struct chain_t *p_dir);
s32 get_num_entries_and_dos_name(struct super_block *sb, struct chain_t *p_dir, s32 get_num_entries_and_dos_name(struct super_block *sb, struct chain_t *p_dir,
struct uni_name_t *p_uniname, s32 *entries, struct uni_name_t *p_uniname, s32 *entries,
struct dos_name_t *p_dosname); struct dos_name_t *p_dosname);
void exfat_get_uni_name_from_ext_entry(struct super_block *sb,
struct chain_t *p_dir, s32 entry,
u16 *uniname);
s32 extract_uni_name_from_name_entry(struct name_dentry_t *ep, s32 extract_uni_name_from_name_entry(struct name_dentry_t *ep,
u16 *uniname, s32 order); u16 *uniname, s32 order);
s32 exfat_calc_num_entries(struct uni_name_t *p_uniname);
u16 calc_checksum_2byte(void *data, s32 len, u16 chksum, s32 type); u16 calc_checksum_2byte(void *data, s32 len, u16 chksum, s32 type);
/* name resolution functions */ /* name resolution functions */
......
...@@ -156,7 +156,7 @@ s32 clear_cluster(struct super_block *sb, u32 clu) ...@@ -156,7 +156,7 @@ s32 clear_cluster(struct super_block *sb, u32 clu)
return ret; return ret;
} }
s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc, static s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
struct chain_t *p_chain) struct chain_t *p_chain)
{ {
s32 num_clusters = 0; s32 num_clusters = 0;
...@@ -235,7 +235,7 @@ s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc, ...@@ -235,7 +235,7 @@ s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
return num_clusters; return num_clusters;
} }
void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain, static void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain,
s32 do_relse) s32 do_relse)
{ {
s32 num_clusters = 0; s32 num_clusters = 0;
...@@ -341,7 +341,7 @@ s32 count_num_clusters(struct super_block *sb, struct chain_t *p_chain) ...@@ -341,7 +341,7 @@ s32 count_num_clusters(struct super_block *sb, struct chain_t *p_chain)
return count; return count;
} }
s32 exfat_count_used_clusters(struct super_block *sb) static s32 exfat_count_used_clusters(struct super_block *sb)
{ {
int i, map_i, map_b, count = 0; int i, map_i, map_b, count = 0;
u8 k; u8 k;
...@@ -785,7 +785,7 @@ void free_upcase_table(struct super_block *sb) ...@@ -785,7 +785,7 @@ void free_upcase_table(struct super_block *sb)
* Directory Entry Management Functions * Directory Entry Management Functions
*/ */
u32 exfat_get_entry_type(struct dentry_t *p_entry) static u32 exfat_get_entry_type(struct dentry_t *p_entry)
{ {
struct file_dentry_t *ep = (struct file_dentry_t *)p_entry; struct file_dentry_t *ep = (struct file_dentry_t *)p_entry;
...@@ -830,7 +830,7 @@ u32 exfat_get_entry_type(struct dentry_t *p_entry) ...@@ -830,7 +830,7 @@ u32 exfat_get_entry_type(struct dentry_t *p_entry)
return TYPE_BENIGN_SEC; return TYPE_BENIGN_SEC;
} }
void exfat_set_entry_type(struct dentry_t *p_entry, u32 type) static void exfat_set_entry_type(struct dentry_t *p_entry, u32 type)
{ {
struct file_dentry_t *ep = (struct file_dentry_t *)p_entry; struct file_dentry_t *ep = (struct file_dentry_t *)p_entry;
...@@ -860,56 +860,56 @@ void exfat_set_entry_type(struct dentry_t *p_entry, u32 type) ...@@ -860,56 +860,56 @@ void exfat_set_entry_type(struct dentry_t *p_entry, u32 type)
} }
} }
u32 exfat_get_entry_attr(struct dentry_t *p_entry) static u32 exfat_get_entry_attr(struct dentry_t *p_entry)
{ {
struct file_dentry_t *ep = (struct file_dentry_t *)p_entry; struct file_dentry_t *ep = (struct file_dentry_t *)p_entry;
return (u32)GET16_A(ep->attr); return (u32)GET16_A(ep->attr);
} }
void exfat_set_entry_attr(struct dentry_t *p_entry, u32 attr) static void exfat_set_entry_attr(struct dentry_t *p_entry, u32 attr)
{ {
struct file_dentry_t *ep = (struct file_dentry_t *)p_entry; struct file_dentry_t *ep = (struct file_dentry_t *)p_entry;
SET16_A(ep->attr, (u16)attr); SET16_A(ep->attr, (u16)attr);
} }
u8 exfat_get_entry_flag(struct dentry_t *p_entry) static u8 exfat_get_entry_flag(struct dentry_t *p_entry)
{ {
struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry; struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry;
return ep->flags; return ep->flags;
} }
void exfat_set_entry_flag(struct dentry_t *p_entry, u8 flags) static void exfat_set_entry_flag(struct dentry_t *p_entry, u8 flags)
{ {
struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry; struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry;
ep->flags = flags; ep->flags = flags;
} }
u32 exfat_get_entry_clu0(struct dentry_t *p_entry) static u32 exfat_get_entry_clu0(struct dentry_t *p_entry)
{ {
struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry; struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry;
return GET32_A(ep->start_clu); return GET32_A(ep->start_clu);
} }
void exfat_set_entry_clu0(struct dentry_t *p_entry, u32 start_clu) static void exfat_set_entry_clu0(struct dentry_t *p_entry, u32 start_clu)
{ {
struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry; struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry;
SET32_A(ep->start_clu, start_clu); SET32_A(ep->start_clu, start_clu);
} }
u64 exfat_get_entry_size(struct dentry_t *p_entry) static u64 exfat_get_entry_size(struct dentry_t *p_entry)
{ {
struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry; struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry;
return GET64_A(ep->valid_size); return GET64_A(ep->valid_size);
} }
void exfat_set_entry_size(struct dentry_t *p_entry, u64 size) static void exfat_set_entry_size(struct dentry_t *p_entry, u64 size)
{ {
struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry; struct strm_dentry_t *ep = (struct strm_dentry_t *)p_entry;
...@@ -917,7 +917,7 @@ void exfat_set_entry_size(struct dentry_t *p_entry, u64 size) ...@@ -917,7 +917,7 @@ void exfat_set_entry_size(struct dentry_t *p_entry, u64 size)
SET64_A(ep->size, size); SET64_A(ep->size, size);
} }
void exfat_get_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp, static void exfat_get_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
u8 mode) u8 mode)
{ {
u16 t = 0x00, d = 0x21; u16 t = 0x00, d = 0x21;
...@@ -946,7 +946,7 @@ void exfat_get_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp, ...@@ -946,7 +946,7 @@ void exfat_get_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
tp->year = (d >> 9); tp->year = (d >> 9);
} }
void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp, static void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
u8 mode) u8 mode)
{ {
u16 t, d; u16 t, d;
...@@ -971,7 +971,7 @@ void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp, ...@@ -971,7 +971,7 @@ void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
} }
} }
s32 exfat_init_dir_entry(struct super_block *sb, struct chain_t *p_dir, static s32 exfat_init_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, u32 type, u32 start_clu, u64 size) s32 entry, u32 type, u32 start_clu, u64 size)
{ {
sector_t sector; sector_t sector;
...@@ -1086,7 +1086,7 @@ void init_name_entry(struct name_dentry_t *ep, u16 *uniname) ...@@ -1086,7 +1086,7 @@ void init_name_entry(struct name_dentry_t *ep, u16 *uniname)
} }
} }
void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir, static void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, s32 order, s32 num_entries) s32 entry, s32 order, s32 num_entries)
{ {
int i; int i;
...@@ -1670,7 +1670,7 @@ s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_entries ...@@ -1670,7 +1670,7 @@ s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_entries
* -1 : (root dir, ".") it is the root dir itself * -1 : (root dir, ".") it is the root dir itself
* -2 : entry with the name does not exist * -2 : entry with the name does not exist
*/ */
s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir, static s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir,
struct uni_name_t *p_uniname, s32 num_entries, struct uni_name_t *p_uniname, s32 num_entries,
struct dos_name_t *p_dosname, u32 type) struct dos_name_t *p_dosname, u32 type)
{ {
...@@ -1813,7 +1813,7 @@ s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir, ...@@ -1813,7 +1813,7 @@ s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir,
return -2; return -2;
} }
s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir, static s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir,
s32 entry, struct dentry_t *p_entry) s32 entry, struct dentry_t *p_entry)
{ {
int i, count = 0; int i, count = 0;
...@@ -1976,7 +1976,7 @@ s32 get_num_entries_and_dos_name(struct super_block *sb, struct chain_t *p_dir, ...@@ -1976,7 +1976,7 @@ s32 get_num_entries_and_dos_name(struct super_block *sb, struct chain_t *p_dir,
return 0; return 0;
} }
void exfat_get_uni_name_from_ext_entry(struct super_block *sb, static void exfat_get_uni_name_from_ext_entry(struct super_block *sb,
struct chain_t *p_dir, s32 entry, struct chain_t *p_dir, s32 entry,
u16 *uniname) u16 *uniname)
{ {
...@@ -2030,7 +2030,7 @@ s32 extract_uni_name_from_name_entry(struct name_dentry_t *ep, u16 *uniname, ...@@ -2030,7 +2030,7 @@ s32 extract_uni_name_from_name_entry(struct name_dentry_t *ep, u16 *uniname,
return len; return len;
} }
s32 exfat_calc_num_entries(struct uni_name_t *p_uniname) static s32 exfat_calc_num_entries(struct uni_name_t *p_uniname)
{ {
s32 len; s32 len;
......
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