aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-05 16:15:12 -0500
committerJens Axboe <axboe@kernel.dk>2012-03-06 15:27:23 -0500
commit5efd611351d1a847c72d74fb12ff4bd187c0cb2c (patch)
treebac28206d088426ab872eea98155cc100bd8d9b1 /block/blk-core.c
parent7ee9c5620504906e98451dc9a1945b2b9e892cb8 (diff)
blkcg: add blkcg_{init|drain|exit}_queue()
Currently block core calls directly into blk-throttle for init, drain and exit. This patch adds blkcg_{init|drain|exit}_queue() which wraps the blk-throttle functions. This is to give more control and visiblity to blkcg core layer for proper layering. Further patches will add logic common to blkcg policies to the functions. While at it, collapse blk_throtl_release() into blk_throtl_exit(). There's no reason to keep them separate. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 5a1b8cc03003..c3434c6395b9 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -34,6 +34,7 @@
34#include <trace/events/block.h> 34#include <trace/events/block.h>
35 35
36#include "blk.h" 36#include "blk.h"
37#include "blk-cgroup.h"
37 38
38EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_remap); 39EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_remap);
39EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap); 40EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
@@ -280,7 +281,7 @@ EXPORT_SYMBOL(blk_stop_queue);
280 * 281 *
281 * This function does not cancel any asynchronous activity arising 282 * This function does not cancel any asynchronous activity arising
282 * out of elevator or throttling code. That would require elevaotor_exit() 283 * out of elevator or throttling code. That would require elevaotor_exit()
283 * and blk_throtl_exit() to be called with queue lock initialized. 284 * and blkcg_exit_queue() to be called with queue lock initialized.
284 * 285 *
285 */ 286 */
286void blk_sync_queue(struct request_queue *q) 287void blk_sync_queue(struct request_queue *q)
@@ -372,7 +373,7 @@ void blk_drain_queue(struct request_queue *q, bool drain_all)
372 if (q->elevator) 373 if (q->elevator)
373 elv_drain_elevator(q); 374 elv_drain_elevator(q);
374 375
375 blk_throtl_drain(q); 376 blkcg_drain_queue(q);
376 377
377 /* 378 /*
378 * This function might be called on a queue which failed 379 * This function might be called on a queue which failed
@@ -562,7 +563,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
562 */ 563 */
563 q->queue_lock = &q->__queue_lock; 564 q->queue_lock = &q->__queue_lock;
564 565
565 if (blk_throtl_init(q)) 566 if (blkcg_init_queue(q))
566 goto fail_id; 567 goto fail_id;
567 568
568 return q; 569 return q;