libata-sff: ap->[last_]ctl are SFF specific
[safe/jmp/linux-2.6] / include / linux / poll.h
index badd98a..600cc1f 100644 (file)
@@ -6,12 +6,14 @@
 #ifdef __KERNEL__
 
 #include <linux/compiler.h>
+#include <linux/ktime.h>
 #include <linux/wait.h>
 #include <linux/string.h>
 #include <linux/fs.h>
-#include <linux/sched.h>
+#include <linux/sysctl.h>
 #include <asm/uaccess.h>
 
+extern struct ctl_table epoll_table[]; /* for sysctl */
 /* ~832 bytes of stack space used max in sys_select/sys_poll before allocating
    additional memory. */
 #define MAX_STACK_ALLOC 832
@@ -32,6 +34,7 @@ typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_
 
 typedef struct poll_table_struct {
        poll_queue_proc qproc;
+       unsigned long key;
 } poll_table;
 
 static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
@@ -43,12 +46,14 @@ static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_addres
 static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc)
 {
        pt->qproc = qproc;
+       pt->key   = ~0UL; /* all events enabled */
 }
 
 struct poll_table_entry {
-       struct file * filp;
+       struct file *filp;
+       unsigned long key;
        wait_queue_t wait;
-       wait_queue_head_t * wait_address;
+       wait_queue_head_t *wait_address;
 };
 
 /*
@@ -56,7 +61,9 @@ struct poll_table_entry {
  */
 struct poll_wqueues {
        poll_table pt;
-       struct poll_table_page * table;
+       struct poll_table_page *table;
+       struct task_struct *polling_task;
+       int triggered;
        int error;
        int inline_index;
        struct poll_table_entry inline_entries[N_INLINE_POLL_ENTRIES];
@@ -64,6 +71,13 @@ struct poll_wqueues {
 
 extern void poll_initwait(struct poll_wqueues *pwq);
 extern void poll_freewait(struct poll_wqueues *pwq);
+extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
+                                ktime_t *expires, unsigned long slack);
+
+static inline int poll_schedule(struct poll_wqueues *pwq, int state)
+{
+       return poll_schedule_timeout(pwq, state, NULL, 0);
+}
 
 /*
  * Scaleable version of the fd_set.