aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2014-04-15 03:04:15 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-06 21:21:54 -0400
commit76f60268e70a700c04c85e1b0d520c94062a40a2 (patch)
tree9309a0812e142e6bae92d71118ade9bd0fcd2a93
parent1e87a78d95ecea7a989349860feb42db3e4b7db5 (diff)
f2fs: call redirty_page_for_writepage
This patch replace some general codes with redirty_page_for_writepage, which can be enabled after consideration on additional procedure like counting dirty pages appropriately. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
-rw-r--r--fs/f2fs/checkpoint.c5
-rw-r--r--fs/f2fs/data.c10
-rw-r--r--fs/f2fs/node.c5
3 files changed, 5 insertions, 15 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 890e23d208a8..2902f7d50770 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -174,10 +174,7 @@ no_write:
174 return 0; 174 return 0;
175 175
176redirty_out: 176redirty_out:
177 dec_page_count(sbi, F2FS_DIRTY_META); 177 redirty_page_for_writepage(wbc, page);
178 wbc->pages_skipped++;
179 account_page_redirty(page);
180 set_page_dirty(page);
181 return AOP_WRITEPAGE_ACTIVATE; 178 return AOP_WRITEPAGE_ACTIVATE;
182} 179}
183 180
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 45abd60e2bff..b5cd6d1c9320 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -798,10 +798,8 @@ static int f2fs_write_data_page(struct page *page,
798 * this page does not have to be written to disk. 798 * this page does not have to be written to disk.
799 */ 799 */
800 offset = i_size & (PAGE_CACHE_SIZE - 1); 800 offset = i_size & (PAGE_CACHE_SIZE - 1);
801 if ((page->index >= end_index + 1) || !offset) { 801 if ((page->index >= end_index + 1) || !offset)
802 inode_dec_dirty_dents(inode);
803 goto out; 802 goto out;
804 }
805 803
806 zero_user_segment(page, offset, PAGE_CACHE_SIZE); 804 zero_user_segment(page, offset, PAGE_CACHE_SIZE);
807write: 805write:
@@ -810,7 +808,6 @@ write:
810 808
811 /* Dentry blocks are controlled by checkpoint */ 809 /* Dentry blocks are controlled by checkpoint */
812 if (S_ISDIR(inode->i_mode)) { 810 if (S_ISDIR(inode->i_mode)) {
813 inode_dec_dirty_dents(inode);
814 err = do_write_data_page(page, &fio); 811 err = do_write_data_page(page, &fio);
815 goto done; 812 goto done;
816 } 813 }
@@ -832,15 +829,14 @@ done:
832 829
833 clear_cold_data(page); 830 clear_cold_data(page);
834out: 831out:
832 inode_dec_dirty_dents(inode);
835 unlock_page(page); 833 unlock_page(page);
836 if (need_balance_fs) 834 if (need_balance_fs)
837 f2fs_balance_fs(sbi); 835 f2fs_balance_fs(sbi);
838 return 0; 836 return 0;
839 837
840redirty_out: 838redirty_out:
841 wbc->pages_skipped++; 839 redirty_page_for_writepage(wbc, page);
842 account_page_redirty(page);
843 set_page_dirty(page);
844 return AOP_WRITEPAGE_ACTIVATE; 840 return AOP_WRITEPAGE_ACTIVATE;
845} 841}
846 842
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index a161e955c4c8..f760793c1a64 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1227,10 +1227,7 @@ static int f2fs_write_node_page(struct page *page,
1227 return 0; 1227 return 0;
1228 1228
1229redirty_out: 1229redirty_out:
1230 dec_page_count(sbi, F2FS_DIRTY_NODES); 1230 redirty_page_for_writepage(wbc, page);
1231 wbc->pages_skipped++;
1232 account_page_redirty(page);
1233 set_page_dirty(page);
1234 return AOP_WRITEPAGE_ACTIVATE; 1231 return AOP_WRITEPAGE_ACTIVATE;
1235} 1232}
1236 1233