From 63d9b2eae7a471c653fb992e6e79b928a6a08e04 Mon Sep 17 00:00:00 2001 From: Jiufei Xue Date: Mon, 30 Sep 2019 11:19:50 +0800 Subject: [PATCH] iocost: add legacy interface file To support cgroup v1. Signed-off-by: Jiufei Xue Reviewed-by: Joseph Qi --- block/blk-iocost.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/block/blk-iocost.c b/block/blk-iocost.c index ecd27ac0391d..6d9e403483eb 100644 --- a/block/blk-iocost.c +++ b/block/blk-iocost.c @@ -2434,8 +2434,31 @@ static struct cftype ioc_files[] = { {} }; +static struct cftype ioc_legacy_files[] = { + { + .name = "cost.weight", + .flags = CFTYPE_NOT_ON_ROOT, + .seq_show = ioc_weight_show, + .write = ioc_weight_write, + }, + { + .name = "cost.qos", + .flags = CFTYPE_ONLY_ON_ROOT, + .seq_show = ioc_qos_show, + .write = ioc_qos_write, + }, + { + .name = "cost.model", + .flags = CFTYPE_ONLY_ON_ROOT, + .seq_show = ioc_cost_model_show, + .write = ioc_cost_model_write, + }, + {} +}; + static struct blkcg_policy blkcg_policy_iocost = { .dfl_cftypes = ioc_files, + .legacy_cftypes = ioc_legacy_files, .cpd_alloc_fn = ioc_cpd_alloc, .cpd_free_fn = ioc_cpd_free, .pd_alloc_fn = ioc_pd_alloc, -- GitLab