aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-02-01 15:24:58 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2018-02-01 16:30:06 -0500
commitd85e2aa2e34dac793e70b900d865f48c69ecbc27 (patch)
treeb9df6e8e2d93d67679d36e7219dc9a10864dc2ec
parentd7ebbe46f445d8c64fa37812818597dc466d74bb (diff)
annotate ep_scan_ready_list()
make it always return __poll_t and have its callbacks do the same Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/eventpoll.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 87452875eaec..d1a490c7e6c3 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -661,12 +661,13 @@ static inline void ep_pm_stay_awake_rcu(struct epitem *epi)
661 * 661 *
662 * Returns: The same integer error code returned by the @sproc callback. 662 * Returns: The same integer error code returned by the @sproc callback.
663 */ 663 */
664static int ep_scan_ready_list(struct eventpoll *ep, 664static __poll_t ep_scan_ready_list(struct eventpoll *ep,
665 int (*sproc)(struct eventpoll *, 665 __poll_t (*sproc)(struct eventpoll *,
666 struct list_head *, void *), 666 struct list_head *, void *),
667 void *priv, int depth, bool ep_locked) 667 void *priv, int depth, bool ep_locked)
668{ 668{
669 int error, pwake = 0; 669 __poll_t res;
670 int pwake = 0;
670 unsigned long flags; 671 unsigned long flags;
671 struct epitem *epi, *nepi; 672 struct epitem *epi, *nepi;
672 LIST_HEAD(txlist); 673 LIST_HEAD(txlist);
@@ -695,7 +696,7 @@ static int ep_scan_ready_list(struct eventpoll *ep,
695 /* 696 /*
696 * Now call the callback function. 697 * Now call the callback function.
697 */ 698 */
698 error = (*sproc)(ep, &txlist, priv); 699 res = (*sproc)(ep, &txlist, priv);
699 700
700 spin_lock_irqsave(&ep->lock, flags); 701 spin_lock_irqsave(&ep->lock, flags);
701 /* 702 /*
@@ -748,7 +749,7 @@ static int ep_scan_ready_list(struct eventpoll *ep,
748 if (pwake) 749 if (pwake)
749 ep_poll_safewake(&ep->poll_wait); 750 ep_poll_safewake(&ep->poll_wait);
750 751
751 return error; 752 return res;
752} 753}
753 754
754static void epi_rcu_free(struct rcu_head *head) 755static void epi_rcu_free(struct rcu_head *head)
@@ -865,7 +866,7 @@ static int ep_eventpoll_release(struct inode *inode, struct file *file)
865 return 0; 866 return 0;
866} 867}
867 868
868static int ep_read_events_proc(struct eventpoll *ep, struct list_head *head, 869static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
869 void *priv); 870 void *priv);
870static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead, 871static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
871 poll_table *pt); 872 poll_table *pt);
@@ -875,7 +876,7 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
875 * the ep->mtx so we need to start from depth=1, such that mutex_lock_nested() 876 * the ep->mtx so we need to start from depth=1, such that mutex_lock_nested()
876 * is correctly annotated. 877 * is correctly annotated.
877 */ 878 */
878static unsigned int ep_item_poll(const struct epitem *epi, poll_table *pt, 879static __poll_t ep_item_poll(const struct epitem *epi, poll_table *pt,
879 int depth) 880 int depth)
880{ 881{
881 struct eventpoll *ep; 882 struct eventpoll *ep;
@@ -895,7 +896,7 @@ static unsigned int ep_item_poll(const struct epitem *epi, poll_table *pt,
895 locked) & epi->event.events; 896 locked) & epi->event.events;
896} 897}
897 898
898static int ep_read_events_proc(struct eventpoll *ep, struct list_head *head, 899static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
899 void *priv) 900 void *priv)
900{ 901{
901 struct epitem *epi, *tmp; 902 struct epitem *epi, *tmp;
@@ -1415,7 +1416,8 @@ static noinline void ep_destroy_wakeup_source(struct epitem *epi)
1415static int ep_insert(struct eventpoll *ep, const struct epoll_event *event, 1416static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
1416 struct file *tfile, int fd, int full_check) 1417 struct file *tfile, int fd, int full_check)
1417{ 1418{
1418 int error, revents, pwake = 0; 1419 int error, pwake = 0;
1420 __poll_t revents;
1419 unsigned long flags; 1421 unsigned long flags;
1420 long user_watches; 1422 long user_watches;
1421 struct epitem *epi; 1423 struct epitem *epi;
@@ -1613,11 +1615,11 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,
1613 return 0; 1615 return 0;
1614} 1616}
1615 1617
1616static int ep_send_events_proc(struct eventpoll *ep, struct list_head *head, 1618static __poll_t ep_send_events_proc(struct eventpoll *ep, struct list_head *head,
1617 void *priv) 1619 void *priv)
1618{ 1620{
1619 struct ep_send_events_data *esed = priv; 1621 struct ep_send_events_data *esed = priv;
1620 unsigned int revents; 1622 __poll_t revents;
1621 struct epitem *epi; 1623 struct epitem *epi;
1622 struct epoll_event __user *uevent; 1624 struct epoll_event __user *uevent;
1623 struct wakeup_source *ws; 1625 struct wakeup_source *ws;