summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavide Libenzi <davidel@xmailserver.org>2002-11-10 20:04:47 -0800
committerAndy Grover <agrover@groveronline.com>2002-11-10 20:04:47 -0800
commitd9bfacbad9db5f2ad34b8e27be6e90e93bdde5cb (patch)
tree52a06d865cadb0bbd91bf181933995e4b00c7c36 /include
parenta3a67b1f88fb6723d14aa5c7b7b0cffb40b70416 (diff)
[PATCH] remove code duplication from fs/eventpoll.c
Clean up poll queue handling, avoid doing any wait-queue operations when we only want to get the current state.
Diffstat (limited to 'include')
-rw-r--r--include/linux/poll.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/include/linux/poll.h b/include/linux/poll.h
index e88468c3b046..416d32e5d8e2 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -11,11 +11,12 @@
#include <asm/uaccess.h>
struct poll_table_page;
+struct poll_table_struct;
+
+typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);
typedef struct poll_table_struct {
- int queue;
- void *priv;
- void (*qproc)(void *, wait_queue_head_t *);
+ poll_queue_proc qproc;
int error;
struct poll_table_page * table;
} poll_table;
@@ -25,16 +26,12 @@ extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, pol
static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{
if (p && wait_address)
- __pollwait(filp, wait_address, p);
+ p->qproc(filp, wait_address, p);
}
-static inline void poll_initwait_ex(poll_table* pt, int queue,
- void (*qproc)(void *, wait_queue_head_t *),
- void *priv)
+static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc)
{
- pt->queue = queue;
pt->qproc = qproc;
- pt->priv = priv;
pt->error = 0;
pt->table = NULL;
}
@@ -42,7 +39,7 @@ static inline void poll_initwait_ex(poll_table* pt, int queue,
static inline void poll_initwait(poll_table* pt)
{
- poll_initwait_ex(pt, 1, NULL, NULL);
+ poll_initwait_ex(pt, __pollwait);
}
extern void poll_freewait(poll_table* pt);