diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-11-28 19:56:15 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-11-28 19:56:15 -0500 |
commit | 69112736e2f025ff3ba280cf81c36e25cf7cc59f (patch) | |
tree | 753f63276600b58d2ebdb2b4b240db3b381e4936 | |
parent | bec1a502d34dcd4d4350a4d9c14fe07561c9516d (diff) |
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: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/eventpoll.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 92f6c30a1dbb..42e35a6977c9 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1488,7 +1488,7 @@ static int ep_insert(struct eventpoll *ep, const struct epoll_event *event, | |||
1488 | ep_set_busy_poll_napi_id(epi); | 1488 | ep_set_busy_poll_napi_id(epi); |
1489 | 1489 | ||
1490 | /* If the file is already "ready" we drop it inside the ready list */ | 1490 | /* If the file is already "ready" we drop it inside the ready list */ |
1491 | if ((revents & event->events) && !ep_is_linked(&epi->rdllink)) { | 1491 | if (revents && !ep_is_linked(&epi->rdllink)) { |
1492 | list_add_tail(&epi->rdllink, &ep->rdllist); | 1492 | list_add_tail(&epi->rdllink, &ep->rdllist); |
1493 | ep_pm_stay_awake(epi); | 1493 | ep_pm_stay_awake(epi); |
1494 | 1494 | ||
@@ -1546,7 +1546,6 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, | |||
1546 | const struct epoll_event *event) | 1546 | const struct epoll_event *event) |
1547 | { | 1547 | { |
1548 | int pwake = 0; | 1548 | int pwake = 0; |
1549 | unsigned int revents; | ||
1550 | poll_table pt; | 1549 | poll_table pt; |
1551 | 1550 | ||
1552 | init_poll_funcptr(&pt, NULL); | 1551 | init_poll_funcptr(&pt, NULL); |
@@ -1588,14 +1587,10 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi, | |||
1588 | /* | 1587 | /* |
1589 | * Get current event bits. We can safely use the file* here because | 1588 | * Get current event bits. We can safely use the file* here because |
1590 | * its usage count has been increased by the caller of this function. | 1589 | * its usage count has been increased by the caller of this function. |
1591 | */ | ||
1592 | revents = ep_item_poll(epi, &pt, 1); | ||
1593 | |||
1594 | /* | ||
1595 | * If the item is "hot" and it is not registered inside the ready | 1590 | * If the item is "hot" and it is not registered inside the ready |
1596 | * list, push it inside. | 1591 | * list, push it inside. |
1597 | */ | 1592 | */ |
1598 | if (revents & event->events) { | 1593 | if (ep_item_poll(epi, &pt, 1)) { |
1599 | spin_lock_irq(&ep->lock); | 1594 | spin_lock_irq(&ep->lock); |
1600 | if (!ep_is_linked(&epi->rdllink)) { | 1595 | if (!ep_is_linked(&epi->rdllink)) { |
1601 | list_add_tail(&epi->rdllink, &ep->rdllist); | 1596 | list_add_tail(&epi->rdllink, &ep->rdllist); |