Commit 52b0c470 authored by Tetsuhiro Kohada's avatar Tetsuhiro Kohada Committed by Greg Kroah-Hartman

staging: exfat: remove fs_func struct.

Remove 'fs_func struct' and change indirect calls to direct calls.

The following issues are described in exfat's TODO.
> Create helper function for exfat_set_entry_time () and
> exfat_set_entry_type () because it's sort of ugly to be calling the same functionn directly and other code calling through  the fs_func struc ponters ...

The fs_func struct was used for switching the helper functions of fat16/fat32/exfat.
Now, it has lost the role of switching, just making the code less readable.
Signed-off-by: default avatarTetsuhiro Kohada <Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp>
Link: https://lore.kernel.org/r/20200123102445.123033-1-Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jpSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd4217cb
......@@ -516,49 +516,6 @@ struct buf_cache_t {
struct buffer_head *buf_bh;
};
struct fs_func {
s32 (*alloc_cluster)(struct super_block *sb, s32 num_alloc,
struct chain_t *p_chain);
void (*free_cluster)(struct super_block *sb, struct chain_t *p_chain,
s32 do_relse);
s32 (*count_used_clusters)(struct super_block *sb);
s32 (*init_dir_entry)(struct super_block *sb, struct chain_t *p_dir,
s32 entry, u32 type, u32 start_clu, u64 size);
s32 (*init_ext_entry)(struct super_block *sb, struct chain_t *p_dir,
s32 entry, s32 num_entries,
struct uni_name_t *p_uniname,
struct dos_name_t *p_dosname);
s32 (*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);
void (*delete_dir_entry)(struct super_block *sb,
struct chain_t *p_dir, s32 entry,
s32 offset, s32 num_entries);
void (*get_uni_name_from_ext_entry)(struct super_block *sb,
struct chain_t *p_dir, s32 entry,
u16 *uniname);
s32 (*count_ext_entries)(struct super_block *sb,
struct chain_t *p_dir, s32 entry,
struct dentry_t *p_entry);
s32 (*calc_num_entries)(struct uni_name_t *p_uniname);
u32 (*get_entry_type)(struct dentry_t *p_entry);
void (*set_entry_type)(struct dentry_t *p_entry, u32 type);
u32 (*get_entry_attr)(struct dentry_t *p_entry);
void (*set_entry_attr)(struct dentry_t *p_entry, u32 attr);
u8 (*get_entry_flag)(struct dentry_t *p_entry);
void (*set_entry_flag)(struct dentry_t *p_entry, u8 flag);
u32 (*get_entry_clu0)(struct dentry_t *p_entry);
void (*set_entry_clu0)(struct dentry_t *p_entry, u32 clu0);
u64 (*get_entry_size)(struct dentry_t *p_entry);
void (*set_entry_size)(struct dentry_t *p_entry, u64 size);
void (*get_entry_time)(struct dentry_t *p_entry,
struct timestamp_t *tp, u8 mode);
void (*set_entry_time)(struct dentry_t *p_entry,
struct timestamp_t *tp, u8 mode);
};
struct fs_info_t {
u32 drv; /* drive ID */
u32 vol_type; /* volume FAT type */
......@@ -597,7 +554,6 @@ struct fs_info_t {
u32 dev_ejected; /* block device operation error flag */
struct fs_func *fs_func;
struct mutex v_mutex;
/* FAT cache */
......@@ -829,5 +785,40 @@ int exfat_bdev_write(struct super_block *sb, sector_t secno,
struct buffer_head *bh, u32 num_secs, bool sync);
int exfat_bdev_sync(struct super_block *sb);
/* cluster operation functions */
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);
s32 exfat_count_used_clusters(struct super_block *sb);
/* dir operation functions */
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);
void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
s32 entry, s32 order, s32 num_entries);
void exfat_get_uni_name_from_ext_entry(struct super_block *sb,
struct chain_t *p_dir, s32 entry,
u16 *uniname);
s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir,
s32 entry, struct dentry_t *p_entry);
s32 exfat_calc_num_entries(struct uni_name_t *p_uniname);
/* dir entry getter/setter */
u32 exfat_get_entry_type(struct dentry_t *p_entry);
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 flags);
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);
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);
extern const u8 uni_upcase[];
#endif /* _EXFAT_H */
This diff is collapsed.
This diff is collapsed.
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