aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c46
1 files changed, 21 insertions, 25 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index dc32dae01e5f..74dc57c74349 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -209,7 +209,7 @@ int dirty_bytes_handler(struct ctl_table *table, int write,
209 struct file *filp, void __user *buffer, size_t *lenp, 209 struct file *filp, void __user *buffer, size_t *lenp,
210 loff_t *ppos) 210 loff_t *ppos)
211{ 211{
212 int old_bytes = vm_dirty_bytes; 212 unsigned long old_bytes = vm_dirty_bytes;
213 int ret; 213 int ret;
214 214
215 ret = proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos); 215 ret = proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos);
@@ -240,7 +240,7 @@ void bdi_writeout_inc(struct backing_dev_info *bdi)
240} 240}
241EXPORT_SYMBOL_GPL(bdi_writeout_inc); 241EXPORT_SYMBOL_GPL(bdi_writeout_inc);
242 242
243static inline void task_dirty_inc(struct task_struct *tsk) 243void task_dirty_inc(struct task_struct *tsk)
244{ 244{
245 prop_inc_single(&vm_dirties, &tsk->dirties); 245 prop_inc_single(&vm_dirties, &tsk->dirties);
246} 246}
@@ -1051,20 +1051,23 @@ continue_unlock:
1051 } 1051 }
1052 } 1052 }
1053 1053
1054 if (nr_to_write > 0) 1054 if (nr_to_write > 0) {
1055 nr_to_write--; 1055 nr_to_write--;
1056 else if (wbc->sync_mode == WB_SYNC_NONE) { 1056 if (nr_to_write == 0 &&
1057 /* 1057 wbc->sync_mode == WB_SYNC_NONE) {
1058 * We stop writing back only if we are not 1058 /*
1059 * doing integrity sync. In case of integrity 1059 * We stop writing back only if we are
1060 * sync we have to keep going because someone 1060 * not doing integrity sync. In case of
1061 * may be concurrently dirtying pages, and we 1061 * integrity sync we have to keep going
1062 * might have synced a lot of newly appeared 1062 * because someone may be concurrently
1063 * dirty pages, but have not synced all of the 1063 * dirtying pages, and we might have
1064 * old dirty pages. 1064 * synced a lot of newly appeared dirty
1065 */ 1065 * pages, but have not synced all of the
1066 done = 1; 1066 * old dirty pages.
1067 break; 1067 */
1068 done = 1;
1069 break;
1070 }
1068 } 1071 }
1069 1072
1070 if (wbc->nonblocking && bdi_write_congested(bdi)) { 1073 if (wbc->nonblocking && bdi_write_congested(bdi)) {
@@ -1076,7 +1079,7 @@ continue_unlock:
1076 pagevec_release(&pvec); 1079 pagevec_release(&pvec);
1077 cond_resched(); 1080 cond_resched();
1078 } 1081 }
1079 if (!cycled) { 1082 if (!cycled && !done) {
1080 /* 1083 /*
1081 * range_cyclic: 1084 * range_cyclic:
1082 * We hit the last page and there is more work to be done: wrap 1085 * We hit the last page and there is more work to be done: wrap
@@ -1227,6 +1230,7 @@ int __set_page_dirty_nobuffers(struct page *page)
1227 __inc_zone_page_state(page, NR_FILE_DIRTY); 1230 __inc_zone_page_state(page, NR_FILE_DIRTY);
1228 __inc_bdi_stat(mapping->backing_dev_info, 1231 __inc_bdi_stat(mapping->backing_dev_info,
1229 BDI_RECLAIMABLE); 1232 BDI_RECLAIMABLE);
1233 task_dirty_inc(current);
1230 task_io_account_write(PAGE_CACHE_SIZE); 1234 task_io_account_write(PAGE_CACHE_SIZE);
1231 } 1235 }
1232 radix_tree_tag_set(&mapping->page_tree, 1236 radix_tree_tag_set(&mapping->page_tree,
@@ -1259,7 +1263,7 @@ EXPORT_SYMBOL(redirty_page_for_writepage);
1259 * If the mapping doesn't provide a set_page_dirty a_op, then 1263 * If the mapping doesn't provide a set_page_dirty a_op, then
1260 * just fall through and assume that it wants buffer_heads. 1264 * just fall through and assume that it wants buffer_heads.
1261 */ 1265 */
1262static int __set_page_dirty(struct page *page) 1266int set_page_dirty(struct page *page)
1263{ 1267{
1264 struct address_space *mapping = page_mapping(page); 1268 struct address_space *mapping = page_mapping(page);
1265 1269
@@ -1277,14 +1281,6 @@ static int __set_page_dirty(struct page *page)
1277 } 1281 }
1278 return 0; 1282 return 0;
1279} 1283}
1280
1281int set_page_dirty(struct page *page)
1282{
1283 int ret = __set_page_dirty(page);
1284 if (ret)
1285 task_dirty_inc(current);
1286 return ret;
1287}
1288EXPORT_SYMBOL(set_page_dirty); 1284EXPORT_SYMBOL(set_page_dirty);
1289 1285
1290/* 1286/*