Cgroup has a standardized poll/notification mechanism for waking all pollers on all fds when a filesystem node changes. To allow polling for custom events, add a .poll callback that can override the default. This is in preparation for pollable cgroup pressure files which have per-fd trigger configurations.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -32,6 +32,7 @@ struct kernfs_node; · 31 unmodified lines | ||
| 32 | 32 | struct kernfs_ops; |
| 33 | 33 | struct kernfs_open_file; |
| 34 | 34 | struct seq_file; |
| 35 | +struct poll_table_struct; | |
| 35 | 36 | |
| 36 | 37 | #define MAX_CGROUP_TYPE_NAMELEN 32 |
| 37 | 38 | #define MAX_CGROUP_ROOT_NAMELEN 64 |
| @@ -574,6 +575,9 @@ struct cftype { · 536 unmodified lines | ||
| 574 | 575 | ssize_t (*write)(struct kernfs_open_file *of, |
| 575 | 576 | char *buf, size_t nbytes, loff_t off); |
| 576 | 577 | |
| 578 | + __poll_t (*poll)(struct kernfs_open_file *of, | |
| 579 | + struct poll_table_struct *pt); | |
| 580 | + | |
| 577 | 581 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 578 | 582 | struct lock_class_key lockdep_key; |
| 579 | 583 | #endif |