diff options
author | Tejun Heo <tj@kernel.org> | 2013-05-14 16:52:31 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-05-14 16:52:31 -0400 |
commit | a9131a27e2a3272df2207277a2be90377ce75fc6 (patch) | |
tree | c1b9cf9382cbf730e714f1f6d872adafdb0911a7 /block | |
parent | cb76199c36a7ccf0947ef4875b32e0940f50d1a8 (diff) |
blk-throttle: relocate throtl_schedule_delayed_work()
Move throtl_schedule_delayed_work() above its first user so that the
forward declaration can be removed.
This patch is pure relocaiton.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-throttle.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 0a0bc00059df..507b1c608941 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -25,8 +25,6 @@ static struct blkcg_policy blkcg_policy_throtl; | |||
25 | 25 | ||
26 | /* A workqueue to queue throttle related work */ | 26 | /* A workqueue to queue throttle related work */ |
27 | static struct workqueue_struct *kthrotld_workqueue; | 27 | static struct workqueue_struct *kthrotld_workqueue; |
28 | static void throtl_schedule_delayed_work(struct throtl_data *td, | ||
29 | unsigned long delay); | ||
30 | 28 | ||
31 | struct throtl_rb_root { | 29 | struct throtl_rb_root { |
32 | struct rb_root rb; | 30 | struct rb_root rb; |
@@ -398,6 +396,19 @@ static void throtl_dequeue_tg(struct throtl_data *td, struct throtl_grp *tg) | |||
398 | __throtl_dequeue_tg(td, tg); | 396 | __throtl_dequeue_tg(td, tg); |
399 | } | 397 | } |
400 | 398 | ||
399 | /* Call with queue lock held */ | ||
400 | static void throtl_schedule_delayed_work(struct throtl_data *td, | ||
401 | unsigned long delay) | ||
402 | { | ||
403 | struct delayed_work *dwork = &td->dispatch_work; | ||
404 | |||
405 | if (total_nr_queued(td)) { | ||
406 | mod_delayed_work(kthrotld_workqueue, dwork, delay); | ||
407 | throtl_log(td, "schedule work. delay=%lu jiffies=%lu", | ||
408 | delay, jiffies); | ||
409 | } | ||
410 | } | ||
411 | |||
401 | static void throtl_schedule_next_dispatch(struct throtl_data *td) | 412 | static void throtl_schedule_next_dispatch(struct throtl_data *td) |
402 | { | 413 | { |
403 | struct throtl_rb_root *st = &td->tg_service_tree; | 414 | struct throtl_rb_root *st = &td->tg_service_tree; |
@@ -863,20 +874,6 @@ out: | |||
863 | } | 874 | } |
864 | } | 875 | } |
865 | 876 | ||
866 | /* Call with queue lock held */ | ||
867 | static void | ||
868 | throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay) | ||
869 | { | ||
870 | |||
871 | struct delayed_work *dwork = &td->dispatch_work; | ||
872 | |||
873 | if (total_nr_queued(td)) { | ||
874 | mod_delayed_work(kthrotld_workqueue, dwork, delay); | ||
875 | throtl_log(td, "schedule work. delay=%lu jiffies=%lu", | ||
876 | delay, jiffies); | ||
877 | } | ||
878 | } | ||
879 | |||
880 | static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, | 877 | static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, |
881 | struct blkg_policy_data *pd, int off) | 878 | struct blkg_policy_data *pd, int off) |
882 | { | 879 | { |