* [PATCH 1/3] f2fs: skip writing in ->writepages when no dirty pages exist
@ 2015-07-17 10:02 Chao Yu
0 siblings, 0 replies; only message in thread
From: Chao Yu @ 2015-07-17 10:02 UTC (permalink / raw)
To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel
When flushing comes from background, if there is no dirty page in the
mapping of inode, we'd better to skip seeking dirty page from mapping
for writebacking.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
---
fs/f2fs/data.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index b621c08..5370a74 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1284,6 +1284,10 @@ static int f2fs_write_data_pages(struct address_space *mapping,
if (!mapping->a_ops->writepage)
return 0;
+ /* skip writing if there is no dirty page in this inode */
+ if (!get_dirty_pages(inode) && wbc->sync_mode == WB_SYNC_NONE)
+ return 0;
+
if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE &&
get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
available_free_memory(sbi, DIRTY_DENTS))
--
2.4.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-17 10:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-17 10:02 [PATCH 1/3] f2fs: skip writing in ->writepages when no dirty pages exist Chao Yu
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).