aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-09-12 18:53:45 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-09-16 07:10:39 -0400
commita7ffdbe22cecaed59b5d76a5f003d68907d64240 (patch)
tree455b985cab6761423687153ca36aae86058a2fa8 /fs/f2fs/data.c
parent2403c155b83c09d8b6255237ef049f2650f9fe01 (diff)
f2fs: expand counting dirty pages in the inode page cache
Previously f2fs only counts dirty dentry pages, but there is no reason not to expand the scope. This patch changes the names on the management of dirty pages and to count dirty pages in each inode info as well. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 64d855085edf..0e376585e29f 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -843,7 +843,7 @@ write:
843 if (unlikely(f2fs_cp_error(sbi))) { 843 if (unlikely(f2fs_cp_error(sbi))) {
844 SetPageError(page); 844 SetPageError(page);
845 unlock_page(page); 845 unlock_page(page);
846 return 0; 846 goto out;
847 } 847 }
848 848
849 if (!wbc->for_reclaim) 849 if (!wbc->for_reclaim)
@@ -863,7 +863,7 @@ done:
863 863
864 clear_cold_data(page); 864 clear_cold_data(page);
865out: 865out:
866 inode_dec_dirty_dents(inode); 866 inode_dec_dirty_pages(inode);
867 unlock_page(page); 867 unlock_page(page);
868 if (need_balance_fs) 868 if (need_balance_fs)
869 f2fs_balance_fs(sbi); 869 f2fs_balance_fs(sbi);
@@ -901,7 +901,7 @@ static int f2fs_write_data_pages(struct address_space *mapping,
901 return 0; 901 return 0;
902 902
903 if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE && 903 if (S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_NONE &&
904 get_dirty_dents(inode) < nr_pages_to_skip(sbi, DATA) && 904 get_dirty_pages(inode) < nr_pages_to_skip(sbi, DATA) &&
905 available_free_memory(sbi, DIRTY_DENTS)) 905 available_free_memory(sbi, DIRTY_DENTS))
906 goto skip_write; 906 goto skip_write;
907 907
@@ -923,7 +923,7 @@ static int f2fs_write_data_pages(struct address_space *mapping,
923 return ret; 923 return ret;
924 924
925skip_write: 925skip_write:
926 wbc->pages_skipped += get_dirty_dents(inode); 926 wbc->pages_skipped += get_dirty_pages(inode);
927 return 0; 927 return 0;
928} 928}
929 929
@@ -1107,8 +1107,12 @@ static void f2fs_invalidate_data_page(struct page *page, unsigned int offset,
1107 unsigned int length) 1107 unsigned int length)
1108{ 1108{
1109 struct inode *inode = page->mapping->host; 1109 struct inode *inode = page->mapping->host;
1110
1111 if (offset % PAGE_CACHE_SIZE || length != PAGE_CACHE_SIZE)
1112 return;
1113
1110 if (PageDirty(page)) 1114 if (PageDirty(page))
1111 inode_dec_dirty_dents(inode); 1115 inode_dec_dirty_pages(inode);
1112 ClearPagePrivate(page); 1116 ClearPagePrivate(page);
1113} 1117}
1114 1118
@@ -1130,7 +1134,7 @@ static int f2fs_set_data_page_dirty(struct page *page)
1130 1134
1131 if (!PageDirty(page)) { 1135 if (!PageDirty(page)) {
1132 __set_page_dirty_nobuffers(page); 1136 __set_page_dirty_nobuffers(page);
1133 set_dirty_dir_page(inode, page); 1137 update_dirty_page(inode, page);
1134 return 1; 1138 return 1;
1135 } 1139 }
1136 return 0; 1140 return 0;