diff options
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index d42d826ece39..b302ce1d662b 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/genhd.h> | 20 | #include <linux/genhd.h> |
21 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
22 | #include "blk-cgroup.h" | 22 | #include "blk-cgroup.h" |
23 | #include "blk.h" | ||
23 | 24 | ||
24 | #define MAX_KEY_LEN 100 | 25 | #define MAX_KEY_LEN 100 |
25 | 26 | ||
@@ -1459,6 +1460,47 @@ done: | |||
1459 | return &blkcg->css; | 1460 | return &blkcg->css; |
1460 | } | 1461 | } |
1461 | 1462 | ||
1463 | /** | ||
1464 | * blkcg_init_queue - initialize blkcg part of request queue | ||
1465 | * @q: request_queue to initialize | ||
1466 | * | ||
1467 | * Called from blk_alloc_queue_node(). Responsible for initializing blkcg | ||
1468 | * part of new request_queue @q. | ||
1469 | * | ||
1470 | * RETURNS: | ||
1471 | * 0 on success, -errno on failure. | ||
1472 | */ | ||
1473 | int blkcg_init_queue(struct request_queue *q) | ||
1474 | { | ||
1475 | might_sleep(); | ||
1476 | |||
1477 | return blk_throtl_init(q); | ||
1478 | } | ||
1479 | |||
1480 | /** | ||
1481 | * blkcg_drain_queue - drain blkcg part of request_queue | ||
1482 | * @q: request_queue to drain | ||
1483 | * | ||
1484 | * Called from blk_drain_queue(). Responsible for draining blkcg part. | ||
1485 | */ | ||
1486 | void blkcg_drain_queue(struct request_queue *q) | ||
1487 | { | ||
1488 | lockdep_assert_held(q->queue_lock); | ||
1489 | |||
1490 | blk_throtl_drain(q); | ||
1491 | } | ||
1492 | |||
1493 | /** | ||
1494 | * blkcg_exit_queue - exit and release blkcg part of request_queue | ||
1495 | * @q: request_queue being released | ||
1496 | * | ||
1497 | * Called from blk_release_queue(). Responsible for exiting blkcg part. | ||
1498 | */ | ||
1499 | void blkcg_exit_queue(struct request_queue *q) | ||
1500 | { | ||
1501 | blk_throtl_exit(q); | ||
1502 | } | ||
1503 | |||
1462 | /* | 1504 | /* |
1463 | * We cannot support shared io contexts, as we have no mean to support | 1505 | * We cannot support shared io contexts, as we have no mean to support |
1464 | * two tasks with the same ioc in two different groups without major rework | 1506 | * two tasks with the same ioc in two different groups without major rework |