aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-06-14 08:52:35 +0900
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:20:29 +0200
commita50c5f9cb496bdfe1e6bda85584a368e50a6da2c (patch)
treef2d89c6f1edb11dd7288ca780a859ec09c02fc98 /fs/f2fs/node.h
parent34eaf6bec420bd64a9241c5954e18d0ce8fb69e1 (diff)
downloadkernel_samsung_espresso10-a50c5f9cb496bdfe1e6bda85584a368e50a6da2c.zip
kernel_samsung_espresso10-a50c5f9cb496bdfe1e6bda85584a368e50a6da2c.tar.gz
kernel_samsung_espresso10-a50c5f9cb496bdfe1e6bda85584a368e50a6da2c.tar.bz2
f2fs: recover wrong pino after checkpoint during fsync
If a file is linked, f2fs loose its parent inode number so that fsync calls for the linked file should do checkpoint all the time. But, if we can recover its parent inode number after the checkpoint, we can adjust roll-forward mechanism for the further fsync calls, which is able to improve the fsync performance significatly. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> Conflicts: fs/f2fs/file.c Change-Id: Ieef8a90c123fb07290df440e9aef091f256e61c7
Diffstat (limited to 'fs/f2fs/node.h')
-rw-r--r--fs/f2fs/node.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
index a503661..c65fb4f 100644
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -285,10 +285,17 @@ static inline void set_file(struct inode *inode, int type)
F2FS_I(inode)->i_advise |= type;
}
-#define is_cold_file(inode) is_file(inode, FADVISE_COLD_BIT)
-#define is_cp_file(inode) is_file(inode, FADVISE_CP_BIT)
-#define set_cold_file(inode) set_file(inode, FADVISE_COLD_BIT)
-#define set_cp_file(inode) set_file(inode, FADVISE_CP_BIT)
+static inline void clear_file(struct inode *inode, int type)
+{
+ F2FS_I(inode)->i_advise &= ~type;
+}
+
+#define file_is_cold(inode) is_file(inode, FADVISE_COLD_BIT)
+#define file_wrong_pino(inode) is_file(inode, FADVISE_LOST_PINO_BIT)
+#define file_set_cold(inode) set_file(inode, FADVISE_COLD_BIT)
+#define file_lost_pino(inode) set_file(inode, FADVISE_LOST_PINO_BIT)
+#define file_clear_cold(inode) clear_file(inode, FADVISE_COLD_BIT)
+#define file_got_pino(inode) clear_file(inode, FADVISE_LOST_PINO_BIT)
static inline int is_cold_data(struct page *page)
{