git: c1a87ab11976 - stable/15 - LinuxKPI: rcu: add optional condition to list_for_each_entry_rcu()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Sat, 19 Sep 2026 14:40:22 UTC
The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=c1a87ab11976a2c9bdec9d725bc4a17c8ff2d42b

commit c1a87ab11976a2c9bdec9d725bc4a17c8ff2d42b
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2026-08-27 08:04:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-09-19 09:34:09 +0000

    LinuxKPI: rcu: add optional condition to list_for_each_entry_rcu()
    
    list_for_each_entry_rcu() can take an optional condition.  Add the
    macro argument so code remains compiling but do not do anything with
    it just yet.
    
    Leave comments as list_for_each_entry_rcu() likely should have a
    different implementation.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    dumbbell
    Differential Revision: https://reviews.freebsd.org/D59292
    
    (cherry picked from commit e975ce86ff11a330128f5b21c7cd11c28d3aff87)
---
 sys/compat/linuxkpi/common/include/linux/rculist.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/rculist.h b/sys/compat/linuxkpi/common/include/linux/rculist.h
index 066ed92b7996..5d5934bc4443 100644
--- a/sys/compat/linuxkpi/common/include/linux/rculist.h
+++ b/sys/compat/linuxkpi/common/include/linux/rculist.h
@@ -37,7 +37,8 @@
 #define	list_next_rcu(head)	(*((struct list_head **)(&(head)->next)))
 #define	list_prev_rcu(head)	(*((struct list_head **)(&(head)->prev)))
 
-#define	list_for_each_entry_rcu(pos, head, member) \
+/* We are currently ignoring the optional condition to check. */
+#define	list_for_each_entry_rcu(pos, head, member, _condition...) \
 	for (pos = list_entry_rcu((head)->next, typeof(*(pos)), member); \
 	     &(pos)->member != (head);					\
 	     pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member))
@@ -47,8 +48,9 @@
 	     &(pos)->member != (head);					\
 	     pos = list_entry_rcu((pos)->member.next, typeof(*(pos)), member))
 
+/* This should likely be its own implementation. */
 #define	list_for_each_entry_lockless(pos, head, member) \
-	list_for_each_entry_rcu(pos, head, member)
+	list_for_each_entry_rcu(pos, head, member, true)
 
 static inline void
 linux_list_add_rcu(struct list_head *new, struct list_head *prev,