Commit 9435fa8d authored by Valdis Kletnieks's avatar Valdis Kletnieks Committed by Greg Kroah-Hartman

staging: exfat: Clean up the namespace pollution part 4

Relocating these functions to before first use lets us make them static
Signed-off-by: default avatarValdis Kletnieks <Valdis.Kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191112211238.156490-9-Valdis.Kletnieks@vt.eduSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 388cd668
...@@ -775,10 +775,6 @@ void free_upcase_table(struct super_block *sb); ...@@ -775,10 +775,6 @@ void free_upcase_table(struct super_block *sb);
/* dir entry management functions */ /* dir entry management functions */
struct timestamp_t *tm_current(struct timestamp_t *tm); 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, struct dentry_t *get_entry_in_dir(struct super_block *sb, struct chain_t *p_dir,
s32 entry, sector_t *sector); s32 entry, sector_t *sector);
......
...@@ -971,6 +971,45 @@ static void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *t ...@@ -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, 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)
{ {
...@@ -1047,45 +1086,6 @@ static s32 exfat_init_ext_entry(struct super_block *sb, struct chain_t *p_dir, ...@@ -1047,45 +1086,6 @@ static s32 exfat_init_ext_entry(struct super_block *sb, struct chain_t *p_dir,
return 0; 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, 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)
{ {
......
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