提交 69112736 编写于 作者: A Al Viro

eventpoll: no need to mask the result of epi_item_poll() again

two callers that do so don't need to bother - we'd already
masked it with epi->event.events, which
	* couldn't have changed since we are holding ->mtx
	* had been set to event->events
	* is still equal to event->events, since *event is never
changed by anything.
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 bec1a502
...@@ -1488,7 +1488,7 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event, ...@@ -1488,7 +1488,7 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
ep_set_busy_poll_napi_id(epi); ep_set_busy_poll_napi_id(epi);
/* If the file is already "ready" we drop it inside the ready list */ /* If the file is already "ready" we drop it inside the ready list */
if ((revents & event->events) && !ep_is_linked(&epi->rdllink)) { if (revents && !ep_is_linked(&epi->rdllink)) {
list_add_tail(&epi->rdllink, &ep->rdllist); list_add_tail(&epi->rdllink, &ep->rdllist);
ep_pm_stay_awake(epi); ep_pm_stay_awake(epi);
...@@ -1546,7 +1546,6 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, ...@@ -1546,7 +1546,6 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,
const struct epoll_event *event) const struct epoll_event *event)
{ {
int pwake = 0; int pwake = 0;
unsigned int revents;
poll_table pt; poll_table pt;
init_poll_funcptr(&pt, NULL); init_poll_funcptr(&pt, NULL);
...@@ -1588,14 +1587,10 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, ...@@ -1588,14 +1587,10 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,
/* /*
* Get current event bits. We can safely use the file* here because * Get current event bits. We can safely use the file* here because
* its usage count has been increased by the caller of this function. * its usage count has been increased by the caller of this function.
*/
revents = ep_item_poll(epi, &pt, 1);
/*
* If the item is "hot" and it is not registered inside the ready * If the item is "hot" and it is not registered inside the ready
* list, push it inside. * list, push it inside.
*/ */
if (revents & event->events) { if (ep_item_poll(epi, &pt, 1)) {
spin_lock_irq(&ep->lock); spin_lock_irq(&ep->lock);
if (!ep_is_linked(&epi->rdllink)) { if (!ep_is_linked(&epi->rdllink)) {
list_add_tail(&epi->rdllink, &ep->rdllist); list_add_tail(&epi->rdllink, &ep->rdllist);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册