[PATCH 2/3] f2fs: fix to decrease the number of dirty dentry page

From: Jaegeuk Kim
Date: Tue Apr 15 2014 - 07:00:20 EST


The f2fs_write_data_page should decrease the number of dirty dentry page
all the time.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@xxxxxxxxxxx>
---
fs/f2fs/data.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 45abd60..9a3fa38 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -790,6 +790,8 @@ static int f2fs_write_data_page(struct page *page,
.rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE,
};

+ inode_dec_dirty_dents(inode);
+
if (page->index < end_index)
goto write;

@@ -798,10 +800,8 @@ static int f2fs_write_data_page(struct page *page,
* this page does not have to be written to disk.
*/
offset = i_size & (PAGE_CACHE_SIZE - 1);
- if ((page->index >= end_index + 1) || !offset) {
- inode_dec_dirty_dents(inode);
+ if ((page->index >= end_index + 1) || !offset)
goto out;
- }

zero_user_segment(page, offset, PAGE_CACHE_SIZE);
write:
@@ -810,7 +810,6 @@ write:

/* Dentry blocks are controlled by checkpoint */
if (S_ISDIR(inode->i_mode)) {
- inode_dec_dirty_dents(inode);
err = do_write_data_page(page, &fio);
goto done;
}
--
1.8.4.474.g128a96c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/