diff options
Diffstat (limited to 'include/linux/poll.h')
| -rw-r--r-- | include/linux/poll.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/poll.h b/include/linux/poll.h index 8e8f6098508a..51e1b56741fb 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
| @@ -11,6 +11,15 @@ | |||
| 11 | #include <linux/mm.h> | 11 | #include <linux/mm.h> |
| 12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
| 13 | 13 | ||
| 14 | /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating | ||
| 15 | additional memory. */ | ||
| 16 | #define MAX_STACK_ALLOC 832 | ||
| 17 | #define FRONTEND_STACK_ALLOC 256 | ||
| 18 | #define SELECT_STACK_ALLOC FRONTEND_STACK_ALLOC | ||
| 19 | #define POLL_STACK_ALLOC FRONTEND_STACK_ALLOC | ||
| 20 | #define WQUEUES_STACK_ALLOC (MAX_STACK_ALLOC - FRONTEND_STACK_ALLOC) | ||
| 21 | #define N_INLINE_POLL_ENTRIES (WQUEUES_STACK_ALLOC / sizeof(struct poll_table_entry)) | ||
| 22 | |||
| 14 | struct poll_table_struct; | 23 | struct poll_table_struct; |
| 15 | 24 | ||
| 16 | /* | 25 | /* |
| @@ -33,6 +42,12 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | |||
| 33 | pt->qproc = qproc; | 42 | pt->qproc = qproc; |
| 34 | } | 43 | } |
| 35 | 44 | ||
| 45 | struct poll_table_entry { | ||
| 46 | struct file * filp; | ||
| 47 | wait_queue_t wait; | ||
| 48 | wait_queue_head_t * wait_address; | ||
| 49 | }; | ||
| 50 | |||
| 36 | /* | 51 | /* |
| 37 | * Structures and helpers for sys_poll/sys_poll | 52 | * Structures and helpers for sys_poll/sys_poll |
| 38 | */ | 53 | */ |
| @@ -40,6 +55,8 @@ struct poll_wqueues { | |||
| 40 | poll_table pt; | 55 | poll_table pt; |
| 41 | struct poll_table_page * table; | 56 | struct poll_table_page * table; |
| 42 | int error; | 57 | int error; |
| 58 | int inline_index; | ||
| 59 | struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES]; | ||
| 43 | }; | 60 | }; |
| 44 | 61 | ||
| 45 | extern void poll_initwait(struct poll_wqueues *pwq); | 62 | extern void poll_initwait(struct poll_wqueues *pwq); |
