mm: Export symbol ksize()
[linux-2.6-block.git] / mm / page-writeback.c
index dc32dae01e5f53e0b38c1e3c8c11c33e839a423b..6106a5c7ed44d0f8f134a32d4e21834835e7f4c3 100644 (file)
@@ -209,7 +209,7 @@ int dirty_bytes_handler(struct ctl_table *table, int write,
                struct file *filp, void __user *buffer, size_t *lenp,
                loff_t *ppos)
 {
-       int old_bytes = vm_dirty_bytes;
+       unsigned long old_bytes = vm_dirty_bytes;
        int ret;
 
        ret = proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos);
@@ -1051,20 +1051,23 @@ continue_unlock:
                                }
                        }
 
-                       if (nr_to_write > 0)
+                       if (nr_to_write > 0) {
                                nr_to_write--;
-                       else if (wbc->sync_mode == WB_SYNC_NONE) {
-                               /*
-                                * We stop writing back only if we are not
-                                * doing integrity sync. In case of integrity
-                                * sync we have to keep going because someone
-                                * may be concurrently dirtying pages, and we
-                                * might have synced a lot of newly appeared
-                                * dirty pages, but have not synced all of the
-                                * old dirty pages.
-                                */
-                               done = 1;
-                               break;
+                               if (nr_to_write == 0 &&
+                                   wbc->sync_mode == WB_SYNC_NONE) {
+                                       /*
+                                        * We stop writing back only if we are
+                                        * not doing integrity sync. In case of
+                                        * integrity sync we have to keep going
+                                        * because someone may be concurrently
+                                        * dirtying pages, and we might have
+                                        * synced a lot of newly appeared dirty
+                                        * pages, but have not synced all of the
+                                        * old dirty pages.
+                                        */
+                                       done = 1;
+                                       break;
+                               }
                        }
 
                        if (wbc->nonblocking && bdi_write_congested(bdi)) {