Commit 424980a8 authored by Davide Libenzi's avatar Davide Libenzi Committed by Jens Axboe

[PATCH] epoll bits 0.46 ...

- A more uniform poll queueing interface with tips from Manfred

- The f_op->poll() is done outside the irqlock to maintain compatibility
	with existing drivers that assume to be called with irq enabled

- Moved event mask setting inside ep_modify() with tips from John

- Fixed locking to fit the new "poll() outside the lock" approach

- Bufferd userspace event delivery to reduce irq_lock/irq_unlock switching
	rate and to reduce the number of __copy_to_user()

- Comments added
parent 6e941592
This diff is collapsed.
...@@ -54,7 +54,7 @@ struct poll_table_page { ...@@ -54,7 +54,7 @@ struct poll_table_page {
* poll table. * poll table.
*/ */
void poll_freewait(poll_table* pt) void __pollfreewait(poll_table* pt)
{ {
struct poll_table_page * p = pt->table; struct poll_table_page * p = pt->table;
while (p) { while (p) {
......
...@@ -14,14 +14,17 @@ struct poll_table_page; ...@@ -14,14 +14,17 @@ struct poll_table_page;
struct poll_table_struct; struct poll_table_struct;
typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *); typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);
typedef void (*poll_free_proc)(struct poll_table_struct *);
typedef struct poll_table_struct { typedef struct poll_table_struct {
poll_queue_proc qproc; poll_queue_proc qproc;
poll_free_proc fproc;
int error; int error;
struct poll_table_page * table; struct poll_table_page * table;
} poll_table; } poll_table;
extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p); extern void __pollwait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p);
extern void __pollfreewait(poll_table* pt);
static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{ {
...@@ -29,9 +32,10 @@ static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_addres ...@@ -29,9 +32,10 @@ static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_addres
p->qproc(filp, wait_address, p); p->qproc(filp, wait_address, p);
} }
static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc) static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc, poll_free_proc fproc)
{ {
pt->qproc = qproc; pt->qproc = qproc;
pt->fproc = fproc;
pt->error = 0; pt->error = 0;
pt->table = NULL; pt->table = NULL;
} }
...@@ -39,10 +43,15 @@ static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc) ...@@ -39,10 +43,15 @@ static inline void poll_initwait_ex(poll_table* pt, poll_queue_proc qproc)
static inline void poll_initwait(poll_table* pt) static inline void poll_initwait(poll_table* pt)
{ {
poll_initwait_ex(pt, __pollwait); poll_initwait_ex(pt, __pollwait, __pollfreewait);
} }
extern void poll_freewait(poll_table* pt); static inline void poll_freewait(poll_table* pt)
{
if (pt && pt->fproc)
pt->fproc(pt);
}
/* /*
......
...@@ -269,7 +269,7 @@ EXPORT_SYMBOL(generic_file_llseek); ...@@ -269,7 +269,7 @@ EXPORT_SYMBOL(generic_file_llseek);
EXPORT_SYMBOL(remote_llseek); EXPORT_SYMBOL(remote_llseek);
EXPORT_SYMBOL(no_llseek); EXPORT_SYMBOL(no_llseek);
EXPORT_SYMBOL(__pollwait); EXPORT_SYMBOL(__pollwait);
EXPORT_SYMBOL(poll_freewait); EXPORT_SYMBOL(__pollfreewait);
EXPORT_SYMBOL(ROOT_DEV); EXPORT_SYMBOL(ROOT_DEV);
EXPORT_SYMBOL(find_get_page); EXPORT_SYMBOL(find_get_page);
EXPORT_SYMBOL(find_lock_page); EXPORT_SYMBOL(find_lock_page);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment