diff options
author | Tejun Heo <tj@kernel.org> | 2015-05-23 00:13:58 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-06-02 17:33:36 +0300 |
commit | cc395d7f1f7b9c740ab6d367ef1f6eb248595dff (patch) | |
tree | a99a691af5b57da0f323f9e50ecf68be0d97ff01 /mm/backing-dev.c | |
parent | ac7b19a34f332fdf8b13aac8708b14188fd1fbd2 (diff) | |
download | linux-cc395d7f1f7b9c740ab6d367ef1f6eb248595dff.tar.xz |
writeback: implement bdi_wait_for_completion()
If the completion of a wb_writeback_work can be waited upon by setting
its ->done to a struct completion and waiting on it; however, for
cgroup writeback support, it's necessary to issue multiple work items
to multiple bdi_writebacks and wait for the completion of all.
This patch implements wb_completion which can wait for multiple work
items and replaces the struct completion with it. It can be defined
using DEFINE_WB_COMPLETION_ONSTACK(), used for multiple work items and
waited for by wb_wait_for_completion().
Nobody currently issues multiple work items and this patch doesn't
introduce any behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'mm/backing-dev.c')
-rw-r--r-- | mm/backing-dev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index d2f16fc9069a..ad5608d01e8c 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -768,6 +768,7 @@ int bdi_init(struct backing_dev_info *bdi) bdi->max_ratio = 100; bdi->max_prop_frac = FPROP_FRAC_BASE; INIT_LIST_HEAD(&bdi->bdi_list); + init_waitqueue_head(&bdi->wb_waitq); err = wb_init(&bdi->wb, bdi, GFP_KERNEL); if (err) |