aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-11 11:52:48 -0500
committerTejun Heo <tj@kernel.org>2014-02-11 11:52:48 -0500
commit5f46990787e2721b4db190ddc8af6fdbe8f010d7 (patch)
tree5a5e8439e8560eb95a86f58036b5282e1a7036b6 /block/blk-throttle.c
parentde00ffa56ea3132c6013fc8f07133b8a1014cf53 (diff)
cgroup: update the meaning of cftype->max_write_len
cftype->max_write_len is used to extend the maximum size of writes. It's interpreted in such a way that the actual maximum size is one less than the specified value. The default size is defined by CGROUP_LOCAL_BUFFER_SIZE. Its interpretation is quite confusing - its value is decremented by 1 and then compared for equality with max size, which means that the actual default size is CGROUP_LOCAL_BUFFER_SIZE - 2, which is 62 chars. There's no point in having a limit that low. Update its definition so that it means the actual string length sans termination and anything below PAGE_SIZE-1 is treated as PAGE_SIZE-1. .max_write_len for "release_agent" is updated to PATH_MAX-1 and cgroup_release_agent_write() is updated so that the redundant strlen() check is removed and it uses strlcpy() instead of strcpy(). .max_write_len initializations in blk-throttle.c and cfq-iosched.c are no longer necessary and removed. The one in cpuset is kept unchanged as it's an approximated value to begin with. This will also make transition to kernfs smoother. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r--block/blk-throttle.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 1474c3ab7e72..861c363e4129 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1425,28 +1425,24 @@ static struct cftype throtl_files[] = {
1425 .private = offsetof(struct throtl_grp, bps[READ]), 1425 .private = offsetof(struct throtl_grp, bps[READ]),
1426 .seq_show = tg_print_conf_u64, 1426 .seq_show = tg_print_conf_u64,
1427 .write_string = tg_set_conf_u64, 1427 .write_string = tg_set_conf_u64,
1428 .max_write_len = 256,
1429 }, 1428 },
1430 { 1429 {
1431 .name = "throttle.write_bps_device", 1430 .name = "throttle.write_bps_device",
1432 .private = offsetof(struct throtl_grp, bps[WRITE]), 1431 .private = offsetof(struct throtl_grp, bps[WRITE]),
1433 .seq_show = tg_print_conf_u64, 1432 .seq_show = tg_print_conf_u64,
1434 .write_string = tg_set_conf_u64, 1433 .write_string = tg_set_conf_u64,
1435 .max_write_len = 256,
1436 }, 1434 },
1437 { 1435 {
1438 .name = "throttle.read_iops_device", 1436 .name = "throttle.read_iops_device",
1439 .private = offsetof(struct throtl_grp, iops[READ]), 1437 .private = offsetof(struct throtl_grp, iops[READ]),
1440 .seq_show = tg_print_conf_uint, 1438 .seq_show = tg_print_conf_uint,
1441 .write_string = tg_set_conf_uint, 1439 .write_string = tg_set_conf_uint,
1442 .max_write_len = 256,
1443 }, 1440 },
1444 { 1441 {
1445 .name = "throttle.write_iops_device", 1442 .name = "throttle.write_iops_device",
1446 .private = offsetof(struct throtl_grp, iops[WRITE]), 1443 .private = offsetof(struct throtl_grp, iops[WRITE]),
1447 .seq_show = tg_print_conf_uint, 1444 .seq_show = tg_print_conf_uint,
1448 .write_string = tg_set_conf_uint, 1445 .write_string = tg_set_conf_uint,
1449 .max_write_len = 256,
1450 }, 1446 },
1451 { 1447 {
1452 .name = "throttle.io_service_bytes", 1448 .name = "throttle.io_service_bytes",