History

kernel: cgroup: add poll file operation

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.

Johannes Weiner committed 7 years ago

Commit dc505371 parent 147e1a92 files · +16 −0Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/cgroup-defs.h+4−0
@@ -32,6 +32,7 @@ struct kernfs_node; · 31 unmodified lines
3232 struct kernfs_ops;
3333 struct kernfs_open_file;
3434 struct seq_file;
35+struct poll_table_struct;
3536
3637 #define MAX_CGROUP_TYPE_NAMELEN 32
3738 #define MAX_CGROUP_ROOT_NAMELEN 64
@@ -574,6 +575,9 @@ struct cftype { · 536 unmodified lines
574575 ssize_t (*write)(struct kernfs_open_file *of,
575576 char *buf, size_t nbytes, loff_t off);
576577
578+ __poll_t (*poll)(struct kernfs_open_file *of,
579+ struct poll_table_struct *pt);
580+
577581 #ifdef CONFIG_DEBUG_LOCK_ALLOC
578582 struct lock_class_key lockdep_key;
579583 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t