aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h26
1 files changed, 14 insertions, 12 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 4dab5338a97a..e921242186f6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -24,7 +24,7 @@
24#define f2fs_bug_on(condition) BUG_ON(condition) 24#define f2fs_bug_on(condition) BUG_ON(condition)
25#define f2fs_down_write(x, y) down_write_nest_lock(x, y) 25#define f2fs_down_write(x, y) down_write_nest_lock(x, y)
26#else 26#else
27#define f2fs_bug_on(condition) 27#define f2fs_bug_on(condition) WARN_ON(condition)
28#define f2fs_down_write(x, y) down_write(x) 28#define f2fs_down_write(x, y) down_write(x)
29#endif 29#endif
30 30
@@ -395,7 +395,7 @@ enum count_type {
395}; 395};
396 396
397/* 397/*
398 * The below are the page types of bios used in submti_bio(). 398 * The below are the page types of bios used in submit_bio().
399 * The available types are: 399 * The available types are:
400 * DATA User data pages. It operates as async mode. 400 * DATA User data pages. It operates as async mode.
401 * NODE Node pages. It operates as async mode. 401 * NODE Node pages. It operates as async mode.
@@ -470,7 +470,7 @@ struct f2fs_sb_info {
470 struct list_head dir_inode_list; /* dir inode list */ 470 struct list_head dir_inode_list; /* dir inode list */
471 spinlock_t dir_inode_lock; /* for dir inode list lock */ 471 spinlock_t dir_inode_lock; /* for dir inode list lock */
472 472
473 /* basic file system units */ 473 /* basic filesystem units */
474 unsigned int log_sectors_per_block; /* log2 sectors per block */ 474 unsigned int log_sectors_per_block; /* log2 sectors per block */
475 unsigned int log_blocksize; /* log2 block size */ 475 unsigned int log_blocksize; /* log2 block size */
476 unsigned int blocksize; /* block size */ 476 unsigned int blocksize; /* block size */
@@ -799,7 +799,7 @@ static inline block_t __start_cp_addr(struct f2fs_sb_info *sbi)
799 799
800 /* 800 /*
801 * odd numbered checkpoint should at cp segment 0 801 * odd numbered checkpoint should at cp segment 0
802 * and even segent must be at cp segment 1 802 * and even segment must be at cp segment 1
803 */ 803 */
804 if (!(ckpt_version & 1)) 804 if (!(ckpt_version & 1))
805 start_addr += sbi->blocks_per_seg; 805 start_addr += sbi->blocks_per_seg;
@@ -1096,6 +1096,11 @@ static inline int f2fs_readonly(struct super_block *sb)
1096 return sb->s_flags & MS_RDONLY; 1096 return sb->s_flags & MS_RDONLY;
1097} 1097}
1098 1098
1099static inline bool f2fs_cp_error(struct f2fs_sb_info *sbi)
1100{
1101 return is_set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
1102}
1103
1099static inline void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi) 1104static inline void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi)
1100{ 1105{
1101 set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG); 1106 set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
@@ -1117,7 +1122,7 @@ static inline void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi)
1117 */ 1122 */
1118int f2fs_sync_file(struct file *, loff_t, loff_t, int); 1123int f2fs_sync_file(struct file *, loff_t, loff_t, int);
1119void truncate_data_blocks(struct dnode_of_data *); 1124void truncate_data_blocks(struct dnode_of_data *);
1120int truncate_blocks(struct inode *, u64); 1125int truncate_blocks(struct inode *, u64, bool);
1121void f2fs_truncate(struct inode *); 1126void f2fs_truncate(struct inode *);
1122int f2fs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 1127int f2fs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
1123int f2fs_setattr(struct dentry *, struct iattr *); 1128int f2fs_setattr(struct dentry *, struct iattr *);
@@ -1202,10 +1207,8 @@ int sync_node_pages(struct f2fs_sb_info *, nid_t, struct writeback_control *);
1202bool alloc_nid(struct f2fs_sb_info *, nid_t *); 1207bool alloc_nid(struct f2fs_sb_info *, nid_t *);
1203void alloc_nid_done(struct f2fs_sb_info *, nid_t); 1208void alloc_nid_done(struct f2fs_sb_info *, nid_t);
1204void alloc_nid_failed(struct f2fs_sb_info *, nid_t); 1209void alloc_nid_failed(struct f2fs_sb_info *, nid_t);
1205void recover_node_page(struct f2fs_sb_info *, struct page *,
1206 struct f2fs_summary *, struct node_info *, block_t);
1207void recover_inline_xattr(struct inode *, struct page *); 1210void recover_inline_xattr(struct inode *, struct page *);
1208bool recover_xattr_data(struct inode *, struct page *, block_t); 1211void recover_xattr_data(struct inode *, struct page *, block_t);
1209int recover_inode_page(struct f2fs_sb_info *, struct page *); 1212int recover_inode_page(struct f2fs_sb_info *, struct page *);
1210int restore_node_summary(struct f2fs_sb_info *, unsigned int, 1213int restore_node_summary(struct f2fs_sb_info *, unsigned int,
1211 struct f2fs_summary_block *); 1214 struct f2fs_summary_block *);
@@ -1238,8 +1241,6 @@ void write_data_page(struct page *, struct dnode_of_data *, block_t *,
1238void rewrite_data_page(struct page *, block_t, struct f2fs_io_info *); 1241void rewrite_data_page(struct page *, block_t, struct f2fs_io_info *);
1239void recover_data_page(struct f2fs_sb_info *, struct page *, 1242void recover_data_page(struct f2fs_sb_info *, struct page *,
1240 struct f2fs_summary *, block_t, block_t); 1243 struct f2fs_summary *, block_t, block_t);
1241void rewrite_node_page(struct f2fs_sb_info *, struct page *,
1242 struct f2fs_summary *, block_t, block_t);
1243void allocate_data_block(struct f2fs_sb_info *, struct page *, 1244void allocate_data_block(struct f2fs_sb_info *, struct page *,
1244 block_t, block_t *, struct f2fs_summary *, int); 1245 block_t, block_t *, struct f2fs_summary *, int);
1245void f2fs_wait_on_page_writeback(struct page *, enum page_type); 1246void f2fs_wait_on_page_writeback(struct page *, enum page_type);
@@ -1262,6 +1263,7 @@ int ra_meta_pages(struct f2fs_sb_info *, int, int, int);
1262long sync_meta_pages(struct f2fs_sb_info *, enum page_type, long); 1263long sync_meta_pages(struct f2fs_sb_info *, enum page_type, long);
1263void add_dirty_inode(struct f2fs_sb_info *, nid_t, int type); 1264void add_dirty_inode(struct f2fs_sb_info *, nid_t, int type);
1264void remove_dirty_inode(struct f2fs_sb_info *, nid_t, int type); 1265void remove_dirty_inode(struct f2fs_sb_info *, nid_t, int type);
1266void release_dirty_inode(struct f2fs_sb_info *);
1265bool exist_written_data(struct f2fs_sb_info *, nid_t, int); 1267bool exist_written_data(struct f2fs_sb_info *, nid_t, int);
1266int acquire_orphan_inode(struct f2fs_sb_info *); 1268int acquire_orphan_inode(struct f2fs_sb_info *);
1267void release_orphan_inode(struct f2fs_sb_info *); 1269void release_orphan_inode(struct f2fs_sb_info *);
@@ -1439,8 +1441,8 @@ extern const struct inode_operations f2fs_special_inode_operations;
1439 */ 1441 */
1440bool f2fs_may_inline(struct inode *); 1442bool f2fs_may_inline(struct inode *);
1441int f2fs_read_inline_data(struct inode *, struct page *); 1443int f2fs_read_inline_data(struct inode *, struct page *);
1442int f2fs_convert_inline_data(struct inode *, pgoff_t); 1444int f2fs_convert_inline_data(struct inode *, pgoff_t, struct page *);
1443int f2fs_write_inline_data(struct inode *, struct page *, unsigned int); 1445int f2fs_write_inline_data(struct inode *, struct page *, unsigned int);
1444void truncate_inline_data(struct inode *, u64); 1446void truncate_inline_data(struct inode *, u64);
1445int recover_inline_data(struct inode *, struct page *); 1447bool recover_inline_data(struct inode *, struct page *);
1446#endif 1448#endif