writeback: make wakeup_dirtytime_writeback() handle multiple bdi_writeback's
authorTejun Heo <tj@kernel.org>
Fri, 22 May 2015 21:13:56 +0000 (17:13 -0400)
committerJens Axboe <axboe@fb.com>
Tue, 2 Jun 2015 14:33:36 +0000 (08:33 -0600)
wakeup_dirtytime_writeback() currently only starts writeback on the
root wb (bdi_writeback).  For cgroup writeback support, update the
function to check all wbs.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jan Kara <jack@suse.cz>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/fs-writeback.c

index 508e10cc3fcd974e5d3c05bbf83a1d719699515a..8ae212e90ec3549764f084dbf417ee33a1b53501 100644 (file)
@@ -1260,9 +1260,12 @@ static void wakeup_dirtytime_writeback(struct work_struct *w)
 
        rcu_read_lock();
        list_for_each_entry_rcu(bdi, &bdi_list, bdi_list) {
-               if (list_empty(&bdi->wb.b_dirty_time))
-                       continue;
-               wb_wakeup(&bdi->wb);
+               struct bdi_writeback *wb;
+               struct wb_iter iter;
+
+               bdi_for_each_wb(wb, bdi, &iter, 0)
+                       if (!list_empty(&bdi->wb.b_dirty_time))
+                               wb_wakeup(&bdi->wb);
        }
        rcu_read_unlock();
        schedule_delayed_work(&dirtytime_work, dirtytime_expire_interval * HZ);