diff options
Diffstat (limited to 'fs/eventpoll.c')
| -rw-r--r-- | fs/eventpoll.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 08e7e6a555ca..8d544334bcd2 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * fs/eventpoll.c ( Efficent event polling implementation ) | 2 | * fs/eventpoll.c ( Efficent event polling implementation ) |
| 3 | * Copyright (C) 2001,...,2003 Davide Libenzi | 3 | * Copyright (C) 2001,...,2006 Davide Libenzi |
| 4 | * | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by |
| @@ -120,7 +120,7 @@ struct epoll_filefd { | |||
| 120 | */ | 120 | */ |
| 121 | struct wake_task_node { | 121 | struct wake_task_node { |
| 122 | struct list_head llink; | 122 | struct list_head llink; |
| 123 | task_t *task; | 123 | struct task_struct *task; |
| 124 | wait_queue_head_t *wq; | 124 | wait_queue_head_t *wq; |
| 125 | }; | 125 | }; |
| 126 | 126 | ||
| @@ -413,7 +413,7 @@ static void ep_poll_safewake(struct poll_safewake *psw, wait_queue_head_t *wq) | |||
| 413 | { | 413 | { |
| 414 | int wake_nests = 0; | 414 | int wake_nests = 0; |
| 415 | unsigned long flags; | 415 | unsigned long flags; |
| 416 | task_t *this_task = current; | 416 | struct task_struct *this_task = current; |
| 417 | struct list_head *lsthead = &psw->wake_task_list, *lnk; | 417 | struct list_head *lsthead = &psw->wake_task_list, *lnk; |
| 418 | struct wake_task_node *tncur; | 418 | struct wake_task_node *tncur; |
| 419 | struct wake_task_node tnode; | 419 | struct wake_task_node tnode; |
| @@ -1004,7 +1004,7 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event, | |||
| 1004 | 1004 | ||
| 1005 | /* Notify waiting tasks that events are available */ | 1005 | /* Notify waiting tasks that events are available */ |
| 1006 | if (waitqueue_active(&ep->wq)) | 1006 | if (waitqueue_active(&ep->wq)) |
| 1007 | wake_up(&ep->wq); | 1007 | __wake_up_locked(&ep->wq, TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE); |
| 1008 | if (waitqueue_active(&ep->poll_wait)) | 1008 | if (waitqueue_active(&ep->poll_wait)) |
| 1009 | pwake++; | 1009 | pwake++; |
| 1010 | } | 1010 | } |
| @@ -1083,7 +1083,8 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, struct epoll_even | |||
| 1083 | 1083 | ||
| 1084 | /* Notify waiting tasks that events are available */ | 1084 | /* Notify waiting tasks that events are available */ |
| 1085 | if (waitqueue_active(&ep->wq)) | 1085 | if (waitqueue_active(&ep->wq)) |
| 1086 | wake_up(&ep->wq); | 1086 | __wake_up_locked(&ep->wq, TASK_UNINTERRUPTIBLE | |
| 1087 | TASK_INTERRUPTIBLE); | ||
| 1087 | if (waitqueue_active(&ep->poll_wait)) | 1088 | if (waitqueue_active(&ep->poll_wait)) |
| 1088 | pwake++; | 1089 | pwake++; |
| 1089 | } | 1090 | } |
| @@ -1167,7 +1168,7 @@ static int ep_unlink(struct eventpoll *ep, struct epitem *epi) | |||
| 1167 | eexit_1: | 1168 | eexit_1: |
| 1168 | 1169 | ||
| 1169 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_unlink(%p, %p) = %d\n", | 1170 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: ep_unlink(%p, %p) = %d\n", |
| 1170 | current, ep, epi->file, error)); | 1171 | current, ep, epi->ffd.file, error)); |
| 1171 | 1172 | ||
| 1172 | return error; | 1173 | return error; |
| 1173 | } | 1174 | } |
| @@ -1235,7 +1236,7 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k | |||
| 1235 | struct eventpoll *ep = epi->ep; | 1236 | struct eventpoll *ep = epi->ep; |
| 1236 | 1237 | ||
| 1237 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: poll_callback(%p) epi=%p ep=%p\n", | 1238 | DNPRINTK(3, (KERN_INFO "[%p] eventpoll: poll_callback(%p) epi=%p ep=%p\n", |
| 1238 | current, epi->file, epi, ep)); | 1239 | current, epi->ffd.file, epi, ep)); |
| 1239 | 1240 | ||
| 1240 | write_lock_irqsave(&ep->lock, flags); | 1241 | write_lock_irqsave(&ep->lock, flags); |
| 1241 | 1242 | ||
| @@ -1260,7 +1261,8 @@ is_linked: | |||
| 1260 | * wait list. | 1261 | * wait list. |
| 1261 | */ | 1262 | */ |
| 1262 | if (waitqueue_active(&ep->wq)) | 1263 | if (waitqueue_active(&ep->wq)) |
| 1263 | wake_up(&ep->wq); | 1264 | __wake_up_locked(&ep->wq, TASK_UNINTERRUPTIBLE | |
| 1265 | TASK_INTERRUPTIBLE); | ||
| 1264 | if (waitqueue_active(&ep->poll_wait)) | 1266 | if (waitqueue_active(&ep->poll_wait)) |
| 1265 | pwake++; | 1267 | pwake++; |
| 1266 | 1268 | ||
| @@ -1444,7 +1446,8 @@ static void ep_reinject_items(struct eventpoll *ep, struct list_head *txlist) | |||
| 1444 | * wait list. | 1446 | * wait list. |
| 1445 | */ | 1447 | */ |
| 1446 | if (waitqueue_active(&ep->wq)) | 1448 | if (waitqueue_active(&ep->wq)) |
| 1447 | wake_up(&ep->wq); | 1449 | __wake_up_locked(&ep->wq, TASK_UNINTERRUPTIBLE | |
| 1450 | TASK_INTERRUPTIBLE); | ||
| 1448 | if (waitqueue_active(&ep->poll_wait)) | 1451 | if (waitqueue_active(&ep->poll_wait)) |
| 1449 | pwake++; | 1452 | pwake++; |
| 1450 | } | 1453 | } |
| @@ -1516,7 +1519,7 @@ retry: | |||
| 1516 | * ep_poll_callback() when events will become available. | 1519 | * ep_poll_callback() when events will become available. |
| 1517 | */ | 1520 | */ |
| 1518 | init_waitqueue_entry(&wait, current); | 1521 | init_waitqueue_entry(&wait, current); |
| 1519 | add_wait_queue(&ep->wq, &wait); | 1522 | __add_wait_queue(&ep->wq, &wait); |
| 1520 | 1523 | ||
| 1521 | for (;;) { | 1524 | for (;;) { |
| 1522 | /* | 1525 | /* |
| @@ -1536,7 +1539,7 @@ retry: | |||
| 1536 | jtimeout = schedule_timeout(jtimeout); | 1539 | jtimeout = schedule_timeout(jtimeout); |
| 1537 | write_lock_irqsave(&ep->lock, flags); | 1540 | write_lock_irqsave(&ep->lock, flags); |
| 1538 | } | 1541 | } |
| 1539 | remove_wait_queue(&ep->wq, &wait); | 1542 | __remove_wait_queue(&ep->wq, &wait); |
| 1540 | 1543 | ||
| 1541 | set_current_state(TASK_RUNNING); | 1544 | set_current_state(TASK_RUNNING); |
| 1542 | } | 1545 | } |
| @@ -1587,7 +1590,6 @@ static struct inode *ep_eventpoll_inode(void) | |||
| 1587 | inode->i_uid = current->fsuid; | 1590 | inode->i_uid = current->fsuid; |
| 1588 | inode->i_gid = current->fsgid; | 1591 | inode->i_gid = current->fsgid; |
| 1589 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 1592 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
| 1590 | inode->i_blksize = PAGE_SIZE; | ||
| 1591 | return inode; | 1593 | return inode; |
| 1592 | 1594 | ||
| 1593 | eexit_1: | 1595 | eexit_1: |
