diff options
author | Tejun Heo <tj@kernel.org> | 2014-05-13 12:16:21 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-05-13 12:16:21 -0400 |
commit | 6770c64e5c8da4705d1f0973bdeb5c2bf4f3a404 (patch) | |
tree | 29e16383df94d4a31f6fec2f49f5ae84c369f911 /kernel/cgroup.c | |
parent | 451af504df0c62f695a69b83c250486e77c66378 (diff) |
cgroup: replace cftype->trigger() with cftype->write()
cftype->trigger() is pointless. It's trivial to ignore the input
buffer from a regular ->write() operation. Convert all ->trigger()
users to ->write() and remove ->trigger().
This patch doesn't introduce any visible behavior changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 2a88ce7b24b6..2f16aab03493 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -1034,8 +1034,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft) | |||
1034 | if (cft->read_u64 || cft->read_s64 || cft->seq_show) | 1034 | if (cft->read_u64 || cft->read_s64 || cft->seq_show) |
1035 | mode |= S_IRUGO; | 1035 | mode |= S_IRUGO; |
1036 | 1036 | ||
1037 | if (cft->write_u64 || cft->write_s64 || cft->write || | 1037 | if (cft->write_u64 || cft->write_s64 || cft->write) |
1038 | cft->trigger) | ||
1039 | mode |= S_IWUSR; | 1038 | mode |= S_IWUSR; |
1040 | 1039 | ||
1041 | return mode; | 1040 | return mode; |
@@ -2750,8 +2749,6 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf, | |||
2750 | ret = kstrtoll(buf, 0, &v); | 2749 | ret = kstrtoll(buf, 0, &v); |
2751 | if (!ret) | 2750 | if (!ret) |
2752 | ret = cft->write_s64(css, cft, v); | 2751 | ret = cft->write_s64(css, cft, v); |
2753 | } else if (cft->trigger) { | ||
2754 | ret = cft->trigger(css, (unsigned int)cft->private); | ||
2755 | } else { | 2752 | } else { |
2756 | ret = -EINVAL; | 2753 | ret = -EINVAL; |
2757 | } | 2754 | } |