diff options
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r-- | block/blk-throttle.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index 06534049afba..a760857e6b62 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -1303,13 +1303,10 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, | |||
1303 | return __blkg_prfill_rwstat(sf, pd, &rwstat); | 1303 | return __blkg_prfill_rwstat(sf, pd, &rwstat); |
1304 | } | 1304 | } |
1305 | 1305 | ||
1306 | static int tg_print_cpu_rwstat(struct cgroup_subsys_state *css, | 1306 | static int tg_print_cpu_rwstat(struct seq_file *sf, void *v) |
1307 | struct cftype *cft, struct seq_file *sf) | ||
1308 | { | 1307 | { |
1309 | struct blkcg *blkcg = css_to_blkcg(css); | 1308 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_cpu_rwstat, |
1310 | 1309 | &blkcg_policy_throtl, seq_cft(sf)->private, true); | |
1311 | blkcg_print_blkgs(sf, blkcg, tg_prfill_cpu_rwstat, &blkcg_policy_throtl, | ||
1312 | cft->private, true); | ||
1313 | return 0; | 1310 | return 0; |
1314 | } | 1311 | } |
1315 | 1312 | ||
@@ -1335,19 +1332,17 @@ static u64 tg_prfill_conf_uint(struct seq_file *sf, struct blkg_policy_data *pd, | |||
1335 | return __blkg_prfill_u64(sf, pd, v); | 1332 | return __blkg_prfill_u64(sf, pd, v); |
1336 | } | 1333 | } |
1337 | 1334 | ||
1338 | static int tg_print_conf_u64(struct cgroup_subsys_state *css, | 1335 | static int tg_print_conf_u64(struct seq_file *sf, void *v) |
1339 | struct cftype *cft, struct seq_file *sf) | ||
1340 | { | 1336 | { |
1341 | blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_u64, | 1337 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_u64, |
1342 | &blkcg_policy_throtl, cft->private, false); | 1338 | &blkcg_policy_throtl, seq_cft(sf)->private, false); |
1343 | return 0; | 1339 | return 0; |
1344 | } | 1340 | } |
1345 | 1341 | ||
1346 | static int tg_print_conf_uint(struct cgroup_subsys_state *css, | 1342 | static int tg_print_conf_uint(struct seq_file *sf, void *v) |
1347 | struct cftype *cft, struct seq_file *sf) | ||
1348 | { | 1343 | { |
1349 | blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_uint, | 1344 | blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_uint, |
1350 | &blkcg_policy_throtl, cft->private, false); | 1345 | &blkcg_policy_throtl, seq_cft(sf)->private, false); |
1351 | return 0; | 1346 | return 0; |
1352 | } | 1347 | } |
1353 | 1348 | ||
@@ -1428,40 +1423,40 @@ static struct cftype throtl_files[] = { | |||
1428 | { | 1423 | { |
1429 | .name = "throttle.read_bps_device", | 1424 | .name = "throttle.read_bps_device", |
1430 | .private = offsetof(struct throtl_grp, bps[READ]), | 1425 | .private = offsetof(struct throtl_grp, bps[READ]), |
1431 | .read_seq_string = tg_print_conf_u64, | 1426 | .seq_show = tg_print_conf_u64, |
1432 | .write_string = tg_set_conf_u64, | 1427 | .write_string = tg_set_conf_u64, |
1433 | .max_write_len = 256, | 1428 | .max_write_len = 256, |
1434 | }, | 1429 | }, |
1435 | { | 1430 | { |
1436 | .name = "throttle.write_bps_device", | 1431 | .name = "throttle.write_bps_device", |
1437 | .private = offsetof(struct throtl_grp, bps[WRITE]), | 1432 | .private = offsetof(struct throtl_grp, bps[WRITE]), |
1438 | .read_seq_string = tg_print_conf_u64, | 1433 | .seq_show = tg_print_conf_u64, |
1439 | .write_string = tg_set_conf_u64, | 1434 | .write_string = tg_set_conf_u64, |
1440 | .max_write_len = 256, | 1435 | .max_write_len = 256, |
1441 | }, | 1436 | }, |
1442 | { | 1437 | { |
1443 | .name = "throttle.read_iops_device", | 1438 | .name = "throttle.read_iops_device", |
1444 | .private = offsetof(struct throtl_grp, iops[READ]), | 1439 | .private = offsetof(struct throtl_grp, iops[READ]), |
1445 | .read_seq_string = tg_print_conf_uint, | 1440 | .seq_show = tg_print_conf_uint, |
1446 | .write_string = tg_set_conf_uint, | 1441 | .write_string = tg_set_conf_uint, |
1447 | .max_write_len = 256, | 1442 | .max_write_len = 256, |
1448 | }, | 1443 | }, |
1449 | { | 1444 | { |
1450 | .name = "throttle.write_iops_device", | 1445 | .name = "throttle.write_iops_device", |
1451 | .private = offsetof(struct throtl_grp, iops[WRITE]), | 1446 | .private = offsetof(struct throtl_grp, iops[WRITE]), |
1452 | .read_seq_string = tg_print_conf_uint, | 1447 | .seq_show = tg_print_conf_uint, |
1453 | .write_string = tg_set_conf_uint, | 1448 | .write_string = tg_set_conf_uint, |
1454 | .max_write_len = 256, | 1449 | .max_write_len = 256, |
1455 | }, | 1450 | }, |
1456 | { | 1451 | { |
1457 | .name = "throttle.io_service_bytes", | 1452 | .name = "throttle.io_service_bytes", |
1458 | .private = offsetof(struct tg_stats_cpu, service_bytes), | 1453 | .private = offsetof(struct tg_stats_cpu, service_bytes), |
1459 | .read_seq_string = tg_print_cpu_rwstat, | 1454 | .seq_show = tg_print_cpu_rwstat, |
1460 | }, | 1455 | }, |
1461 | { | 1456 | { |
1462 | .name = "throttle.io_serviced", | 1457 | .name = "throttle.io_serviced", |
1463 | .private = offsetof(struct tg_stats_cpu, serviced), | 1458 | .private = offsetof(struct tg_stats_cpu, serviced), |
1464 | .read_seq_string = tg_print_cpu_rwstat, | 1459 | .seq_show = tg_print_cpu_rwstat, |
1465 | }, | 1460 | }, |
1466 | { } /* terminate */ | 1461 | { } /* terminate */ |
1467 | }; | 1462 | }; |