The patch titled Subject: fs/eventpoll.c: simplify ep_is_linked() callers has been added to the -mm tree. Its filename is fs-eventpoll-simplify-ep_is_linked-callers.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fs-eventpoll-simplify-ep_is_linked-callers.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fs-eventpoll-simplify-ep_is_linked-callers.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Davidlohr Bueso <dave@xxxxxxxxxxxx> Subject: fs/eventpoll.c: simplify ep_is_linked() callers Instead of having each caller pass the rdllink explicitly, just have ep_is_linked() pass it while the callers just need the epi pointer. This helper is all about the rdllink, and this change, furthermore, improves the function's self documentation. Link: http://lkml.kernel.org/r/20180727053432.16679-3-dave@xxxxxxxxxxxx Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: Jason Baron <jbaron@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- diff -puN fs/eventpoll.c~fs-eventpoll-simplify-ep_is_linked-callers fs/eventpoll.c --- a/fs/eventpoll.c~fs-eventpoll-simplify-ep_is_linked-callers +++ a/fs/eventpoll.c @@ -336,9 +336,9 @@ static inline int ep_cmp_ffd(struct epol } /* Tells us if the item is currently linked */ -static inline int ep_is_linked(struct list_head *p) +static inline int ep_is_linked(struct epitem *epi) { - return !list_empty(p); + return !list_empty(&epi->rdllink); } static inline struct eppoll_entry *ep_pwq_from_wait(wait_queue_entry_t *p) @@ -721,7 +721,7 @@ static __poll_t ep_scan_ready_list(struc * queued into ->ovflist but the "txlist" might already * contain them, and the list_splice() below takes care of them. */ - if (!ep_is_linked(&epi->rdllink)) { + if (!ep_is_linked(epi)) { list_add_tail(&epi->rdllink, &ep->rdllist); ep_pm_stay_awake(epi); } @@ -790,7 +790,7 @@ static int ep_remove(struct eventpoll *e rb_erase_cached(&epi->rbn, &ep->rbr); spin_lock_irq(&ep->wq.lock); - if (ep_is_linked(&epi->rdllink)) + if (ep_is_linked(epi)) list_del_init(&epi->rdllink); spin_unlock_irq(&ep->wq.lock); @@ -1171,7 +1171,7 @@ static int ep_poll_callback(wait_queue_e } /* If this file is already in the ready list we exit soon */ - if (!ep_is_linked(&epi->rdllink)) { + if (!ep_is_linked(epi)) { list_add_tail(&epi->rdllink, &ep->rdllist); ep_pm_stay_awake_rcu(epi); } @@ -1495,7 +1495,7 @@ static int ep_insert(struct eventpoll *e ep_set_busy_poll_napi_id(epi); /* If the file is already "ready" we drop it inside the ready list */ - if (revents && !ep_is_linked(&epi->rdllink)) { + if (revents && !ep_is_linked(epi)) { list_add_tail(&epi->rdllink, &ep->rdllist); ep_pm_stay_awake(epi); @@ -1533,7 +1533,7 @@ error_unregister: * And ep_insert() is called with "mtx" held. */ spin_lock_irq(&ep->wq.lock); - if (ep_is_linked(&epi->rdllink)) + if (ep_is_linked(epi)) list_del_init(&epi->rdllink); spin_unlock_irq(&ep->wq.lock); @@ -1601,7 +1601,7 @@ static int ep_modify(struct eventpoll *e */ if (ep_item_poll(epi, &pt, 1)) { spin_lock_irq(&ep->wq.lock); - if (!ep_is_linked(&epi->rdllink)) { + if (!ep_is_linked(epi)) { list_add_tail(&epi->rdllink, &ep->rdllist); ep_pm_stay_awake(epi); _ Patches currently in -mm which might be from dave@xxxxxxxxxxxx are fs-epoll-loosen-irq-safety-in-ep_scan_ready_list.patch fs-epoll-loosen-irq-safety-in-epoll_insert-and-epoll_remove.patch fs-epoll-robustify-irq-safety-with-lockdep_assert_irqs_enabled.patch fs-epoll-simply-config_net_rx_busy_poll-ifdefery.patch fs-epoll-loosen-irq-safety-in-ep_poll.patch fs-eventpoll-simplify-ep_is_linked-callers.patch ipc-drop-ipc_lock.patch lib-rhashtable-simplify-bucket_table_alloc.patch lib-rhashtable-guarantee-initial-hashtable-allocation.patch ipc-get-rid-of-ids-tables_initialized-hack.patch ipc-simplify-ipc-initialization.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html