Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139195
b: refs/heads/master
c: d1bc90d
h: refs/heads/master
i:
  139193: 7d0a780
  139191: 320c83f
v: v3
  • Loading branch information
Tony Battersby authored and Linus Torvalds committed Apr 1, 2009
1 parent bb2c317 commit d33ce30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0305882825784e74f68a56eee6c3a812a99f235
refs/heads/master: d1bc90dd5d037079f96b3327f943eb6ae8ef7491
22 changes: 8 additions & 14 deletions trunk/fs/eventpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,27 +394,21 @@ static void ep_poll_safewake(wait_queue_head_t *wq)
}

/*
* This function unregister poll callbacks from the associated file descriptor.
* Since this must be called without holding "ep->lock" the atomic exchange trick
* will protect us from multiple unregister.
* This function unregisters poll callbacks from the associated file
* descriptor. Must be called with "mtx" held (or "epmutex" if called from
* ep_free).
*/
static void ep_unregister_pollwait(struct eventpoll *ep, struct epitem *epi)
{
int nwait;
struct list_head *lsthead = &epi->pwqlist;
struct eppoll_entry *pwq;

/* This is called without locks, so we need the atomic exchange */
nwait = xchg(&epi->nwait, 0);

if (nwait) {
while (!list_empty(lsthead)) {
pwq = list_first_entry(lsthead, struct eppoll_entry, llink);
while (!list_empty(lsthead)) {
pwq = list_first_entry(lsthead, struct eppoll_entry, llink);

list_del_init(&pwq->llink);
remove_wait_queue(pwq->whead, &pwq->wait);
kmem_cache_free(pwq_cache, pwq);
}
list_del(&pwq->llink);
remove_wait_queue(pwq->whead, &pwq->wait);
kmem_cache_free(pwq_cache, pwq);
}
}

Expand Down

0 comments on commit d33ce30

Please sign in to comment.