linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: check if inode's state is dirty or not before skip fsync
@ 2014-12-01  7:05 Changman Lee
  2014-12-01 22:52 ` [f2fs-dev] " Jaegeuk Kim
  0 siblings, 1 reply; 8+ messages in thread
From: Changman Lee @ 2014-12-01  7:05 UTC (permalink / raw)
  To: linux-fsdevel, linux-f2fs-devel; +Cc: Changman Lee

It makes sense to check inode's state than check if
inode page is dirty or not.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
---
 fs/f2fs/file.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 7c2ec3e..0c5ae87 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -173,14 +173,11 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
 	 */
 	if (!is_inode_flag_set(fi, FI_APPEND_WRITE) &&
 			!exist_written_data(sbi, ino, APPEND_INO)) {
-		struct page *i = find_get_page(NODE_MAPPING(sbi), ino);
 
 		/* But we need to avoid that there are some inode updates */
-		if ((i && PageDirty(i)) || need_inode_block_update(sbi, ino)) {
-			f2fs_put_page(i, 0);
+		if (is_inode_flag_set(fi, FI_DIRTY_INODE) ||
+					need_inode_block_update(sbi, ino))
 			goto go_write;
-		}
-		f2fs_put_page(i, 0);
 
 		if (is_inode_flag_set(fi, FI_UPDATE_WRITE) ||
 				exist_written_data(sbi, ino, UPDATE_INO))
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-05 18:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01  7:05 [PATCH] f2fs: check if inode's state is dirty or not before skip fsync Changman Lee
2014-12-01 22:52 ` [f2fs-dev] " Jaegeuk Kim
2014-12-02  4:21   ` Changman Lee
2014-12-02 19:42     ` Jaegeuk Kim
2014-12-03  1:46       ` Changman Lee
2014-12-05  0:58         ` Jaegeuk Kim
2014-12-05  2:10           ` Changman Lee
2014-12-05 18:09             ` Jaegeuk Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).