diff options
author | Tejun Heo <tj@kernel.org> | 2014-02-11 11:52:48 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-02-11 11:52:48 -0500 |
commit | 5f46990787e2721b4db190ddc8af6fdbe8f010d7 (patch) | |
tree | 5a5e8439e8560eb95a86f58036b5282e1a7036b6 /block/cfq-iosched.c | |
parent | de00ffa56ea3132c6013fc8f07133b8a1014cf53 (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/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 744833b630c6..461187943392 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1838,7 +1838,6 @@ static struct cftype cfq_blkcg_files[] = { | |||
1838 | .flags = CFTYPE_ONLY_ON_ROOT, | 1838 | .flags = CFTYPE_ONLY_ON_ROOT, |
1839 | .seq_show = cfqg_print_leaf_weight_device, | 1839 | .seq_show = cfqg_print_leaf_weight_device, |
1840 | .write_string = cfqg_set_leaf_weight_device, | 1840 | .write_string = cfqg_set_leaf_weight_device, |
1841 | .max_write_len = 256, | ||
1842 | }, | 1841 | }, |
1843 | { | 1842 | { |
1844 | .name = "weight", | 1843 | .name = "weight", |
@@ -1853,7 +1852,6 @@ static struct cftype cfq_blkcg_files[] = { | |||
1853 | .flags = CFTYPE_NOT_ON_ROOT, | 1852 | .flags = CFTYPE_NOT_ON_ROOT, |
1854 | .seq_show = cfqg_print_weight_device, | 1853 | .seq_show = cfqg_print_weight_device, |
1855 | .write_string = cfqg_set_weight_device, | 1854 | .write_string = cfqg_set_weight_device, |
1856 | .max_write_len = 256, | ||
1857 | }, | 1855 | }, |
1858 | { | 1856 | { |
1859 | .name = "weight", | 1857 | .name = "weight", |
@@ -1866,7 +1864,6 @@ static struct cftype cfq_blkcg_files[] = { | |||
1866 | .name = "leaf_weight_device", | 1864 | .name = "leaf_weight_device", |
1867 | .seq_show = cfqg_print_leaf_weight_device, | 1865 | .seq_show = cfqg_print_leaf_weight_device, |
1868 | .write_string = cfqg_set_leaf_weight_device, | 1866 | .write_string = cfqg_set_leaf_weight_device, |
1869 | .max_write_len = 256, | ||
1870 | }, | 1867 | }, |
1871 | { | 1868 | { |
1872 | .name = "leaf_weight", | 1869 | .name = "leaf_weight", |