mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
cgroups: add the trigger callback to struct cftype
Trigger callback can be used to receive a kick-up from the user space. The string written is ignored. The cftype->private is used for multiplexing events. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Paul Menage <menage@google.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
46ae220bea
commit
d447ea2f30
2 changed files with 12 additions and 0 deletions
|
@ -1410,6 +1410,10 @@ static ssize_t cgroup_file_write(struct file *file, const char __user *buf,
|
|||
return cft->write(cgrp, cft, file, buf, nbytes, ppos);
|
||||
if (cft->write_u64 || cft->write_s64)
|
||||
return cgroup_write_X64(cgrp, cft, file, buf, nbytes, ppos);
|
||||
if (cft->trigger) {
|
||||
int ret = cft->trigger(cgrp, (unsigned int)cft->private);
|
||||
return ret ? ret : nbytes;
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue