diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cgroup.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 2a59d3101e5d..b4f2201321cd 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -235,6 +235,10 @@ struct cgroup { | |||
235 | 235 | ||
236 | /* For RCU-protected deletion */ | 236 | /* For RCU-protected deletion */ |
237 | struct rcu_head rcu_head; | 237 | struct rcu_head rcu_head; |
238 | |||
239 | /* List of events which userspace want to recieve */ | ||
240 | struct list_head event_list; | ||
241 | spinlock_t event_list_lock; | ||
238 | }; | 242 | }; |
239 | 243 | ||
240 | /* | 244 | /* |
@@ -378,6 +382,26 @@ struct cftype { | |||
378 | int (*trigger)(struct cgroup *cgrp, unsigned int event); | 382 | int (*trigger)(struct cgroup *cgrp, unsigned int event); |
379 | 383 | ||
380 | int (*release)(struct inode *inode, struct file *file); | 384 | int (*release)(struct inode *inode, struct file *file); |
385 | |||
386 | /* | ||
387 | * register_event() callback will be used to add new userspace | ||
388 | * waiter for changes related to the cftype. Implement it if | ||
389 | * you want to provide this functionality. Use eventfd_signal() | ||
390 | * on eventfd to send notification to userspace. | ||
391 | */ | ||
392 | int (*register_event)(struct cgroup *cgrp, struct cftype *cft, | ||
393 | struct eventfd_ctx *eventfd, const char *args); | ||
394 | /* | ||
395 | * unregister_event() callback will be called when userspace | ||
396 | * closes the eventfd or on cgroup removing. | ||
397 | * This callback must be implemented, if you want provide | ||
398 | * notification functionality. | ||
399 | * | ||
400 | * Be careful. It can be called after destroy(), so you have | ||
401 | * to keep all nesessary data, until all events are removed. | ||
402 | */ | ||
403 | int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, | ||
404 | struct eventfd_ctx *eventfd); | ||
381 | }; | 405 | }; |
382 | 406 | ||
383 | struct cgroup_scanner { | 407 | struct cgroup_scanner { |