f2fs.h (ad2e6329666650d9cafcae9ef53fbe09ea759ae2) | f2fs.h (6e6093a8f144414d904575da5fdea40cf14fb63e) |
---|---|
1/* 2 * fs/f2fs/f2fs.h 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 197 unchanged lines hidden (view full) --- 206 unsigned int ofs_in_node; /* data offset in the node page */ 207 bool inode_page_locked; /* inode page is locked or not */ 208 block_t data_blkaddr; /* block address of the node block */ 209}; 210 211static inline void set_new_dnode(struct dnode_of_data *dn, struct inode *inode, 212 struct page *ipage, struct page *npage, nid_t nid) 213{ | 1/* 2 * fs/f2fs/f2fs.h 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License version 2 as --- 197 unchanged lines hidden (view full) --- 206 unsigned int ofs_in_node; /* data offset in the node page */ 207 bool inode_page_locked; /* inode page is locked or not */ 208 block_t data_blkaddr; /* block address of the node block */ 209}; 210 211static inline void set_new_dnode(struct dnode_of_data *dn, struct inode *inode, 212 struct page *ipage, struct page *npage, nid_t nid) 213{ |
214 memset(dn, 0, sizeof(*dn)); |
|
214 dn->inode = inode; 215 dn->inode_page = ipage; 216 dn->node_page = npage; 217 dn->nid = nid; | 215 dn->inode = inode; 216 dn->inode_page = ipage; 217 dn->node_page = npage; 218 dn->nid = nid; |
218 dn->inode_page_locked = 0; | |
219} 220 221/* 222 * For SIT manager 223 * 224 * By default, there are 6 active log areas across the whole main area. 225 * When considering hot and cold data separation to reduce cleaning overhead, 226 * we split 3 for data logs and 3 for node logs as hot, warm, and cold types, --- 645 unchanged lines hidden (view full) --- 872void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *); 873int f2fs_make_empty(struct inode *, struct inode *); 874bool f2fs_empty_dir(struct inode *); 875 876/* 877 * super.c 878 */ 879int f2fs_sync_fs(struct super_block *, int); | 219} 220 221/* 222 * For SIT manager 223 * 224 * By default, there are 6 active log areas across the whole main area. 225 * When considering hot and cold data separation to reduce cleaning overhead, 226 * we split 3 for data logs and 3 for node logs as hot, warm, and cold types, --- 645 unchanged lines hidden (view full) --- 872void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *); 873int f2fs_make_empty(struct inode *, struct inode *); 874bool f2fs_empty_dir(struct inode *); 875 876/* 877 * super.c 878 */ 879int f2fs_sync_fs(struct super_block *, int); |
880extern __printf(3, 4) 881void f2fs_msg(struct super_block *, const char *, const char *, ...); |
|
880 881/* 882 * hash.c 883 */ 884f2fs_hash_t f2fs_dentry_hash(const char *, size_t); 885 886/* 887 * node.c --- 19 unchanged lines hidden (view full) --- 907void recover_node_page(struct f2fs_sb_info *, struct page *, 908 struct f2fs_summary *, struct node_info *, block_t); 909int recover_inode_page(struct f2fs_sb_info *, struct page *); 910int restore_node_summary(struct f2fs_sb_info *, unsigned int, 911 struct f2fs_summary_block *); 912void flush_nat_entries(struct f2fs_sb_info *); 913int build_node_manager(struct f2fs_sb_info *); 914void destroy_node_manager(struct f2fs_sb_info *); | 882 883/* 884 * hash.c 885 */ 886f2fs_hash_t f2fs_dentry_hash(const char *, size_t); 887 888/* 889 * node.c --- 19 unchanged lines hidden (view full) --- 909void recover_node_page(struct f2fs_sb_info *, struct page *, 910 struct f2fs_summary *, struct node_info *, block_t); 911int recover_inode_page(struct f2fs_sb_info *, struct page *); 912int restore_node_summary(struct f2fs_sb_info *, unsigned int, 913 struct f2fs_summary_block *); 914void flush_nat_entries(struct f2fs_sb_info *); 915int build_node_manager(struct f2fs_sb_info *); 916void destroy_node_manager(struct f2fs_sb_info *); |
915int create_node_manager_caches(void); | 917int __init create_node_manager_caches(void); |
916void destroy_node_manager_caches(void); 917 918/* 919 * segment.c 920 */ 921void f2fs_balance_fs(struct f2fs_sb_info *); 922void invalidate_blocks(struct f2fs_sb_info *, block_t); 923void locate_dirty_segment(struct f2fs_sb_info *, unsigned int); --- 35 unchanged lines hidden (view full) --- 959int recover_orphan_inodes(struct f2fs_sb_info *); 960int get_valid_checkpoint(struct f2fs_sb_info *); 961void set_dirty_dir_page(struct inode *, struct page *); 962void remove_dirty_dir_inode(struct inode *); 963void sync_dirty_dir_inodes(struct f2fs_sb_info *); 964void block_operations(struct f2fs_sb_info *); 965void write_checkpoint(struct f2fs_sb_info *, bool, bool); 966void init_orphan_info(struct f2fs_sb_info *); | 918void destroy_node_manager_caches(void); 919 920/* 921 * segment.c 922 */ 923void f2fs_balance_fs(struct f2fs_sb_info *); 924void invalidate_blocks(struct f2fs_sb_info *, block_t); 925void locate_dirty_segment(struct f2fs_sb_info *, unsigned int); --- 35 unchanged lines hidden (view full) --- 961int recover_orphan_inodes(struct f2fs_sb_info *); 962int get_valid_checkpoint(struct f2fs_sb_info *); 963void set_dirty_dir_page(struct inode *, struct page *); 964void remove_dirty_dir_inode(struct inode *); 965void sync_dirty_dir_inodes(struct f2fs_sb_info *); 966void block_operations(struct f2fs_sb_info *); 967void write_checkpoint(struct f2fs_sb_info *, bool, bool); 968void init_orphan_info(struct f2fs_sb_info *); |
967int create_checkpoint_caches(void); | 969int __init create_checkpoint_caches(void); |
968void destroy_checkpoint_caches(void); 969 970/* 971 * data.c 972 */ 973int reserve_new_block(struct dnode_of_data *); 974void update_extent_cache(block_t, struct dnode_of_data *); 975struct page *find_data_page(struct inode *, pgoff_t); 976struct page *get_lock_data_page(struct inode *, pgoff_t); 977struct page *get_new_data_page(struct inode *, pgoff_t, bool); 978int f2fs_readpage(struct f2fs_sb_info *, struct page *, block_t, int); 979int do_write_data_page(struct page *); 980 981/* 982 * gc.c 983 */ 984int start_gc_thread(struct f2fs_sb_info *); 985void stop_gc_thread(struct f2fs_sb_info *); 986block_t start_bidx_of_node(unsigned int); | 970void destroy_checkpoint_caches(void); 971 972/* 973 * data.c 974 */ 975int reserve_new_block(struct dnode_of_data *); 976void update_extent_cache(block_t, struct dnode_of_data *); 977struct page *find_data_page(struct inode *, pgoff_t); 978struct page *get_lock_data_page(struct inode *, pgoff_t); 979struct page *get_new_data_page(struct inode *, pgoff_t, bool); 980int f2fs_readpage(struct f2fs_sb_info *, struct page *, block_t, int); 981int do_write_data_page(struct page *); 982 983/* 984 * gc.c 985 */ 986int start_gc_thread(struct f2fs_sb_info *); 987void stop_gc_thread(struct f2fs_sb_info *); 988block_t start_bidx_of_node(unsigned int); |
987int f2fs_gc(struct f2fs_sb_info *, int); | 989int f2fs_gc(struct f2fs_sb_info *); |
988void build_gc_manager(struct f2fs_sb_info *); | 990void build_gc_manager(struct f2fs_sb_info *); |
989int create_gc_caches(void); | 991int __init create_gc_caches(void); |
990void destroy_gc_caches(void); 991 992/* 993 * recovery.c 994 */ 995void recover_fsync_data(struct f2fs_sb_info *); 996bool space_for_roll_forward(struct f2fs_sb_info *); 997 --- 55 unchanged lines hidden (view full) --- 1053 do { \ 1054 struct f2fs_stat_info *si = sbi->stat_info; \ 1055 stat_inc_tot_blk_count(si, blks); \ 1056 si->node_blks += (blks); \ 1057 } while (0) 1058 1059int f2fs_build_stats(struct f2fs_sb_info *); 1060void f2fs_destroy_stats(struct f2fs_sb_info *); | 992void destroy_gc_caches(void); 993 994/* 995 * recovery.c 996 */ 997void recover_fsync_data(struct f2fs_sb_info *); 998bool space_for_roll_forward(struct f2fs_sb_info *); 999 --- 55 unchanged lines hidden (view full) --- 1055 do { \ 1056 struct f2fs_stat_info *si = sbi->stat_info; \ 1057 stat_inc_tot_blk_count(si, blks); \ 1058 si->node_blks += (blks); \ 1059 } while (0) 1060 1061int f2fs_build_stats(struct f2fs_sb_info *); 1062void f2fs_destroy_stats(struct f2fs_sb_info *); |
1061void destroy_root_stats(void); | 1063void __init f2fs_create_root_stats(void); 1064void f2fs_destroy_root_stats(void); |
1062#else 1063#define stat_inc_call_count(si) 1064#define stat_inc_seg_count(si, type) 1065#define stat_inc_tot_blk_count(si, blks) 1066#define stat_inc_data_blk_count(si, blks) 1067#define stat_inc_node_blk_count(sbi, blks) 1068 1069static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; } 1070static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { } | 1065#else 1066#define stat_inc_call_count(si) 1067#define stat_inc_seg_count(si, type) 1068#define stat_inc_tot_blk_count(si, blks) 1069#define stat_inc_data_blk_count(si, blks) 1070#define stat_inc_node_blk_count(sbi, blks) 1071 1072static inline int f2fs_build_stats(struct f2fs_sb_info *sbi) { return 0; } 1073static inline void f2fs_destroy_stats(struct f2fs_sb_info *sbi) { } |
1071static inline void destroy_root_stats(void) { } | 1074static inline void __init f2fs_create_root_stats(void) { } 1075static inline void f2fs_destroy_root_stats(void) { } |
1072#endif 1073 1074extern const struct file_operations f2fs_dir_operations; 1075extern const struct file_operations f2fs_file_operations; 1076extern const struct inode_operations f2fs_file_inode_operations; 1077extern const struct address_space_operations f2fs_dblock_aops; 1078extern const struct address_space_operations f2fs_node_aops; 1079extern const struct address_space_operations f2fs_meta_aops; 1080extern const struct inode_operations f2fs_dir_inode_operations; 1081extern const struct inode_operations f2fs_symlink_inode_operations; 1082extern const struct inode_operations f2fs_special_inode_operations; 1083#endif | 1076#endif 1077 1078extern const struct file_operations f2fs_dir_operations; 1079extern const struct file_operations f2fs_file_operations; 1080extern const struct inode_operations f2fs_file_inode_operations; 1081extern const struct address_space_operations f2fs_dblock_aops; 1082extern const struct address_space_operations f2fs_node_aops; 1083extern const struct address_space_operations f2fs_meta_aops; 1084extern const struct inode_operations f2fs_dir_inode_operations; 1085extern const struct inode_operations f2fs_symlink_inode_operations; 1086extern const struct inode_operations f2fs_special_inode_operations; 1087#endif |