diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-20 21:52:53 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-20 22:10:11 +0900 |
commit | 479f40c44ae30e02642ce0391be707a53852d545 (patch) | |
tree | 0ad83458da430f524f70a681c4d88c1b22e54233 /fs/f2fs/file.c | |
parent | d928bfbfe77aa457b765c19e9db8cd4cc72b3c89 (diff) |
f2fs: skip unnecessary node writes during fsync
If multiple redundant fsync calls are triggered, we don't need to write its
node pages with fsync mark continuously.
So, this patch adds FI_NEED_FSYNC to track whether the latest node block is
written with the fsync mark or not.
If the mark was set, a new fsync doesn't need to write a node block.
Otherwise, we should do a new node block with the mark for roll-forward
recovery.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index a9474cd4e0db..6ba26680c468 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -176,6 +176,8 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync) } else { /* if there is no written node page, write its inode page */ while (!sync_node_pages(sbi, inode->i_ino, &wbc)) { + if (fsync_mark_done(sbi, inode->i_ino)) + goto out; mark_inode_dirty_sync(inode); ret = f2fs_write_inode(inode, NULL); if (ret) |