Skip to content

Commit 52b0c47

Browse files
kohada-t2gregkh
authored andcommitted
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: Tetsuhiro Kohada <[email protected]> Link: https://lore.kernel.org/r/20200123102445.123033-1-Kohada.Tetsuhiro@dc.MitsubishiElectric.co.jp Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bd4217c commit 52b0c47

File tree

3 files changed

+178
-234
lines changed

3 files changed

+178
-234
lines changed

drivers/staging/exfat/exfat.h

Lines changed: 35 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -516,49 +516,6 @@ struct buf_cache_t {
516516
struct buffer_head *buf_bh;
517517
};
518518

519-
struct fs_func {
520-
s32 (*alloc_cluster)(struct super_block *sb, s32 num_alloc,
521-
struct chain_t *p_chain);
522-
void (*free_cluster)(struct super_block *sb, struct chain_t *p_chain,
523-
s32 do_relse);
524-
s32 (*count_used_clusters)(struct super_block *sb);
525-
526-
s32 (*init_dir_entry)(struct super_block *sb, struct chain_t *p_dir,
527-
s32 entry, u32 type, u32 start_clu, u64 size);
528-
s32 (*init_ext_entry)(struct super_block *sb, struct chain_t *p_dir,
529-
s32 entry, s32 num_entries,
530-
struct uni_name_t *p_uniname,
531-
struct dos_name_t *p_dosname);
532-
s32 (*find_dir_entry)(struct super_block *sb, struct chain_t *p_dir,
533-
struct uni_name_t *p_uniname, s32 num_entries,
534-
struct dos_name_t *p_dosname, u32 type);
535-
void (*delete_dir_entry)(struct super_block *sb,
536-
struct chain_t *p_dir, s32 entry,
537-
s32 offset, s32 num_entries);
538-
void (*get_uni_name_from_ext_entry)(struct super_block *sb,
539-
struct chain_t *p_dir, s32 entry,
540-
u16 *uniname);
541-
s32 (*count_ext_entries)(struct super_block *sb,
542-
struct chain_t *p_dir, s32 entry,
543-
struct dentry_t *p_entry);
544-
s32 (*calc_num_entries)(struct uni_name_t *p_uniname);
545-
546-
u32 (*get_entry_type)(struct dentry_t *p_entry);
547-
void (*set_entry_type)(struct dentry_t *p_entry, u32 type);
548-
u32 (*get_entry_attr)(struct dentry_t *p_entry);
549-
void (*set_entry_attr)(struct dentry_t *p_entry, u32 attr);
550-
u8 (*get_entry_flag)(struct dentry_t *p_entry);
551-
void (*set_entry_flag)(struct dentry_t *p_entry, u8 flag);
552-
u32 (*get_entry_clu0)(struct dentry_t *p_entry);
553-
void (*set_entry_clu0)(struct dentry_t *p_entry, u32 clu0);
554-
u64 (*get_entry_size)(struct dentry_t *p_entry);
555-
void (*set_entry_size)(struct dentry_t *p_entry, u64 size);
556-
void (*get_entry_time)(struct dentry_t *p_entry,
557-
struct timestamp_t *tp, u8 mode);
558-
void (*set_entry_time)(struct dentry_t *p_entry,
559-
struct timestamp_t *tp, u8 mode);
560-
};
561-
562519
struct fs_info_t {
563520
u32 drv; /* drive ID */
564521
u32 vol_type; /* volume FAT type */
@@ -597,7 +554,6 @@ struct fs_info_t {
597554

598555
u32 dev_ejected; /* block device operation error flag */
599556

600-
struct fs_func *fs_func;
601557
struct mutex v_mutex;
602558

603559
/* FAT cache */
@@ -829,5 +785,40 @@ int exfat_bdev_write(struct super_block *sb, sector_t secno,
829785
struct buffer_head *bh, u32 num_secs, bool sync);
830786
int exfat_bdev_sync(struct super_block *sb);
831787

788+
/* cluster operation functions */
789+
s32 exfat_alloc_cluster(struct super_block *sb, s32 num_alloc,
790+
struct chain_t *p_chain);
791+
void exfat_free_cluster(struct super_block *sb, struct chain_t *p_chain,
792+
s32 do_relse);
793+
s32 exfat_count_used_clusters(struct super_block *sb);
794+
795+
/* dir operation functions */
796+
s32 exfat_find_dir_entry(struct super_block *sb, struct chain_t *p_dir,
797+
struct uni_name_t *p_uniname, s32 num_entries,
798+
struct dos_name_t *p_dosname, u32 type);
799+
void exfat_delete_dir_entry(struct super_block *sb, struct chain_t *p_dir,
800+
s32 entry, s32 order, s32 num_entries);
801+
void exfat_get_uni_name_from_ext_entry(struct super_block *sb,
802+
struct chain_t *p_dir, s32 entry,
803+
u16 *uniname);
804+
s32 exfat_count_ext_entries(struct super_block *sb, struct chain_t *p_dir,
805+
s32 entry, struct dentry_t *p_entry);
806+
s32 exfat_calc_num_entries(struct uni_name_t *p_uniname);
807+
808+
/* dir entry getter/setter */
809+
u32 exfat_get_entry_type(struct dentry_t *p_entry);
810+
u32 exfat_get_entry_attr(struct dentry_t *p_entry);
811+
void exfat_set_entry_attr(struct dentry_t *p_entry, u32 attr);
812+
u8 exfat_get_entry_flag(struct dentry_t *p_entry);
813+
void exfat_set_entry_flag(struct dentry_t *p_entry, u8 flags);
814+
u32 exfat_get_entry_clu0(struct dentry_t *p_entry);
815+
void exfat_set_entry_clu0(struct dentry_t *p_entry, u32 start_clu);
816+
u64 exfat_get_entry_size(struct dentry_t *p_entry);
817+
void exfat_set_entry_size(struct dentry_t *p_entry, u64 size);
818+
void exfat_get_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
819+
u8 mode);
820+
void exfat_set_entry_time(struct dentry_t *p_entry, struct timestamp_t *tp,
821+
u8 mode);
822+
832823
extern const u8 uni_upcase[];
833824
#endif /* _EXFAT_H */

0 commit comments

Comments
 (0)