From 953a3e27e10fc6acb480801ea47197d0270d735e Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Thu, 21 Mar 2013 15:21:57 +0900 Subject: f2fs: fix to give correct parent inode number for roll forward When we recover fsync'ed data after power-off-recovery, we should guarantee that any parent inode number should be correct for each direct inode blocks. So, let's make the following rules. - The fsync should do checkpoint to all the inodes that were experienced hard links. - So, the only normal files can be recovered by roll-forward. Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fs/f2fs/node.h') diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h index afdb130f782..d009cdfd267 100644 --- a/fs/f2fs/node.h +++ b/fs/f2fs/node.h @@ -277,6 +277,21 @@ static inline int is_cold_file(struct inode *inode) return F2FS_I(inode)->i_advise & FADVISE_COLD_BIT; } +static inline void set_cold_file(struct inode *inode) +{ + F2FS_I(inode)->i_advise |= FADVISE_COLD_BIT; +} + +static inline int is_cp_file(struct inode *inode) +{ + return F2FS_I(inode)->i_advise & FADVISE_CP_BIT; +} + +static inline void set_cp_file(struct inode *inode) +{ + F2FS_I(inode)->i_advise |= FADVISE_CP_BIT; +} + static inline int is_cold_data(struct page *page) { return PageChecked(page); -- cgit v1.2.3