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>
This commit is contained in:
@@ -1034,8 +1034,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft)
|
||||
if (cft->read_u64 || cft->read_s64 || cft->seq_show)
|
||||
mode |= S_IRUGO;
|
||||
|
||||
if (cft->write_u64 || cft->write_s64 || cft->write ||
|
||||
cft->trigger)
|
||||
if (cft->write_u64 || cft->write_s64 || cft->write)
|
||||
mode |= S_IWUSR;
|
||||
|
||||
return mode;
|
||||
@@ -2750,8 +2749,6 @@ static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
|
||||
ret = kstrtoll(buf, 0, &v);
|
||||
if (!ret)
|
||||
ret = cft->write_s64(css, cft, v);
|
||||
} else if (cft->trigger) {
|
||||
ret = cft->trigger(css, (unsigned int)cft->private);
|
||||
} else {
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user