aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r--block/blk-throttle.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index b23193518ac7..f1dd691c5359 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -403,6 +403,11 @@ static void throtl_service_queue_exit(struct throtl_service_queue *sq)
403 del_timer_sync(&sq->pending_timer); 403 del_timer_sync(&sq->pending_timer);
404} 404}
405 405
406static struct blkg_policy_data *throtl_pd_alloc(gfp_t gfp, int node)
407{
408 return kzalloc_node(sizeof(struct throtl_grp), gfp, node);
409}
410
406static void throtl_pd_init(struct blkcg_gq *blkg) 411static void throtl_pd_init(struct blkcg_gq *blkg)
407{ 412{
408 struct throtl_grp *tg = blkg_to_tg(blkg); 413 struct throtl_grp *tg = blkg_to_tg(blkg);
@@ -493,6 +498,11 @@ static void throtl_pd_exit(struct blkcg_gq *blkg)
493 throtl_service_queue_exit(&tg->service_queue); 498 throtl_service_queue_exit(&tg->service_queue);
494} 499}
495 500
501static void throtl_pd_free(struct blkg_policy_data *pd)
502{
503 kfree(pd);
504}
505
496static void throtl_pd_reset_stats(struct blkcg_gq *blkg) 506static void throtl_pd_reset_stats(struct blkcg_gq *blkg)
497{ 507{
498 struct throtl_grp *tg = blkg_to_tg(blkg); 508 struct throtl_grp *tg = blkg_to_tg(blkg);
@@ -1468,12 +1478,13 @@ static void throtl_shutdown_wq(struct request_queue *q)
1468} 1478}
1469 1479
1470static struct blkcg_policy blkcg_policy_throtl = { 1480static struct blkcg_policy blkcg_policy_throtl = {
1471 .pd_size = sizeof(struct throtl_grp),
1472 .cftypes = throtl_files, 1481 .cftypes = throtl_files,
1473 1482
1483 .pd_alloc_fn = throtl_pd_alloc,
1474 .pd_init_fn = throtl_pd_init, 1484 .pd_init_fn = throtl_pd_init,
1475 .pd_online_fn = throtl_pd_online, 1485 .pd_online_fn = throtl_pd_online,
1476 .pd_exit_fn = throtl_pd_exit, 1486 .pd_exit_fn = throtl_pd_exit,
1487 .pd_free_fn = throtl_pd_free,
1477 .pd_reset_stats_fn = throtl_pd_reset_stats, 1488 .pd_reset_stats_fn = throtl_pd_reset_stats,
1478}; 1489};
1479 1490