From: Andrew Morton 80 cols. Cc: Davide Libenzi Signed-off-by: Andrew Morton --- fs/eventpoll.c | 33 ++++++++++++++++----------------- 1 files changed, 16 insertions(+), 17 deletions(-) diff -puN fs/eventpoll.c~epoll-optimizations-and-cleanups-tidy fs/eventpoll.c --- a/fs/eventpoll.c~epoll-optimizations-and-cleanups-tidy +++ a/fs/eventpoll.c @@ -1356,7 +1356,8 @@ static int ep_send_events(struct eventpo /* * We can loop without lock because this is a task private list. * We just splice'd out the ep->rdllist in ep_collect_ready_items(). - * Items cannot vanish during the loop because we are holding "sem" in read. + * Items cannot vanish during the loop because we are holding "sem" in + * read. */ for (eventcnt = 0; !list_empty(txlist) && eventcnt < maxevents;) { epi = list_entry(txlist->next, struct epitem, rdllink); @@ -1390,24 +1391,25 @@ static int ep_send_events(struct eventpo /* * This is tricky. We are holding the "sem" in read, and this * means that the operations that can change the "linked" status - * of the epoll item (epi->rbn and epi->rdllink), cannot touch them. - * Also, since we are "linked" from a epi->rdllink POV (the item - * is linked to our transmission list, we just splice'd), the - * ep_poll_callback() cannot touch us either, because of the check - * present in there. Another parallel epoll_wait() will not - * get the same result set, since we spliced the ready list before. - * Note that list_del() still shows the item as linked to the test - * in ep_poll_callback(). + * of the epoll item (epi->rbn and epi->rdllink), cannot touch + * them. Also, since we are "linked" from a epi->rdllink POV + * (the item is linked to our transmission list we just + * spliced), the ep_poll_callback() cannot touch us either, + * because of the check present in there. Another parallel + * epoll_wait() will not get the same result set, since we + * spliced the ready list before. Note that list_del() still + * shows the item as linked to the test in ep_poll_callback(). */ list_del(&epi->rdllink); - if (!(epi->event.events & EPOLLET) && (revents & epi->event.events)) + if (!(epi->event.events & EPOLLET) && + (revents & epi->event.events)) list_add_tail(&epi->rdllink, &injlist); else { /* - * Be sure the item is totally detached before re-init the - * list_head. After INIT_LIST_HEAD() is committed, the - * ep_poll_callback() can requeue the item again, but we - * don't care since we are already past it. + * Be sure the item is totally detached before re-init + * the list_head. After INIT_LIST_HEAD() is committed, + * the ep_poll_callback() can requeue the item again, + * but we don't care since we are already past it. */ smp_mb(); INIT_LIST_HEAD(&epi->rdllink); @@ -1552,14 +1554,12 @@ retry: return res; } - static int eventpollfs_delete_dentry(struct dentry *dentry) { return 1; } - static struct inode *ep_eventpoll_inode(void) { int error = -ENOMEM; @@ -1587,7 +1587,6 @@ eexit_1: return ERR_PTR(error); } - static int eventpollfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, struct vfsmount *mnt) _