staging: exfat: Clean up the namespace pollution part 4

Relocating these functions to before first use lets us make them static

Signed-off-by: Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191112211238.156490-9-Valdis.Kletnieks@vt.edu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Valdis Kletnieks 2019-11-12 16:12:34 -05:00 committed by Greg Kroah-Hartman
parent 388cd66808
commit 9435fa8d06
2 changed files with 39 additions and 43 deletions

View File

@ -775,10 +775,6 @@ void free_upcase_table(struct super_block *sb);
/* dir entry management functions */
struct timestamp_t *tm_current(struct timestamp_t *tm);
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,
u64 size);
void init_name_entry(struct name_dentry_t *ep, u16 *uniname);
struct dentry_t *get_entry_in_dir(struct super_block *sb, struct chain_t *p_dir,
s32 entry, sector_t *sector);

View File

@ -971,6 +971,45 @@ static void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *t
}
}
static void init_file_entry(struct file_dentry_t *ep, u32 type)
{
struct timestamp_t tm, *tp;
exfat_set_entry_type((struct dentry_t *)ep, type);
tp = tm_current(&tm);
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_CREATE);
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_MODIFY);
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_ACCESS);
ep->create_time_ms = 0;
ep->modify_time_ms = 0;
ep->access_time_ms = 0;
}
static void init_strm_entry(struct strm_dentry_t *ep, u8 flags, u32 start_clu, u64 size)
{
exfat_set_entry_type((struct dentry_t *)ep, TYPE_STREAM);
ep->flags = flags;
SET32_A(ep->start_clu, start_clu);
SET64_A(ep->valid_size, size);
SET64_A(ep->size, size);
}
static void init_name_entry(struct name_dentry_t *ep, u16 *uniname)
{
int i;
exfat_set_entry_type((struct dentry_t *)ep, TYPE_EXTEND);
ep->flags = 0x0;
for (i = 0; i < 30; i++, i++) {
SET16_A(ep->unicode_0_14 + i, *uniname);
if (*uniname == 0x0)
break;
uniname++;
}
}
static s32 exfat_init_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, u32 type, u32 start_clu, u64 size)
{
@ -1047,45 +1086,6 @@ static s32 exfat_init_ext_entry(struct super_block *sb, struct chain_t *p_dir,
return 0;
}
void init_file_entry(struct file_dentry_t *ep, u32 type)
{
struct timestamp_t tm, *tp;
exfat_set_entry_type((struct dentry_t *)ep, type);
tp = tm_current(&tm);
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_CREATE);
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_MODIFY);
exfat_set_entry_time((struct dentry_t *)ep, tp, TM_ACCESS);
ep->create_time_ms = 0;
ep->modify_time_ms = 0;
ep->access_time_ms = 0;
}
void init_strm_entry(struct strm_dentry_t *ep, u8 flags, u32 start_clu, u64 size)
{
exfat_set_entry_type((struct dentry_t *)ep, TYPE_STREAM);
ep->flags = flags;
SET32_A(ep->start_clu, start_clu);
SET64_A(ep->valid_size, size);
SET64_A(ep->size, size);
}
void init_name_entry(struct name_dentry_t *ep, u16 *uniname)
{
int i;
exfat_set_entry_type((struct dentry_t *)ep, TYPE_EXTEND);
ep->flags = 0x0;
for (i = 0; i < 30; i++, i++) {
SET16_A(ep->unicode_0_14 + i, *uniname);
if (*uniname == 0x0)
break;
uniname++;
}
}
static void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, s32 order, s32 num_entries)
{