diff options
| -rw-r--r-- | include/linux/cgroup.h | 8 | ||||
| -rw-r--r-- | kernel/cgroup.c | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 785a01cfb49d..2d1d151258cf 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -243,6 +243,14 @@ struct cftype { | |||
| 243 | */ | 243 | */ |
| 244 | int (*write_s64) (struct cgroup *cgrp, struct cftype *cft, s64 val); | 244 | int (*write_s64) (struct cgroup *cgrp, struct cftype *cft, s64 val); |
| 245 | 245 | ||
| 246 | /* | ||
| 247 | * trigger() callback can be used to get some kick from the | ||
| 248 | * userspace, when the actual string written is not important | ||
| 249 | * at all. The private field can be used to determine the | ||
| 250 | * kick type for multiplexing. | ||
| 251 | */ | ||
| 252 | int (*trigger)(struct cgroup *cgrp, unsigned int event); | ||
| 253 | |||
| 246 | int (*release) (struct inode *inode, struct file *file); | 254 | int (*release) (struct inode *inode, struct file *file); |
| 247 | }; | 255 | }; |
| 248 | 256 | ||
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 436e26f4d624..7c8cc5141877 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -1410,6 +1410,10 @@ static ssize_t cgroup_file_write(struct file *file, const char __user *buf, | |||
| 1410 | return cft->write(cgrp, cft, file, buf, nbytes, ppos); | 1410 | return cft->write(cgrp, cft, file, buf, nbytes, ppos); |
| 1411 | if (cft->write_u64 || cft->write_s64) | 1411 | if (cft->write_u64 || cft->write_s64) |
| 1412 | return cgroup_write_X64(cgrp, cft, file, buf, nbytes, ppos); | 1412 | return cgroup_write_X64(cgrp, cft, file, buf, nbytes, ppos); |
| 1413 | if (cft->trigger) { | ||
| 1414 | int ret = cft->trigger(cgrp, (unsigned int)cft->private); | ||
| 1415 | return ret ? ret : nbytes; | ||
| 1416 | } | ||
| 1413 | return -EINVAL; | 1417 | return -EINVAL; |
| 1414 | } | 1418 | } |
| 1415 | 1419 | ||
