From 66422c27abfdc1c803e3d9a0f60f20d8dbefc95e Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 22 May 2024 20:06:35 +0200 Subject: [PATCH] Kill sched.h dependency on rcupdate.h by moving cond_resched_rcu() to rcupdate_wait.h, we can kill another big sched.h dependency. Signed-off-by: Kent Overstreet Signed-off-by: Jozsef Kadlecsik --- configure.ac | 9 +++++++++ kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | 3 +++ kernel/net/netfilter/ipset/ip_set_bitmap_gen.h | 4 ++++ kernel/net/netfilter/ipset/ip_set_hash_gen.h | 3 +++ 4 files changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 5f1be0e7..fa0e6968 100644 --- a/configure.ac +++ b/configure.ac @@ -900,6 +900,15 @@ else AC_SUBST(HAVE_NF_BRIDGE_GET_PYSINDEV_NET, undef) fi +AC_MSG_CHECKING([kernel source for rcupdate_wait.h]) +if test -f $ksourcedir/include/linux/rcupdate_wait.h; then + AC_MSG_RESULT(yes) + AC_SUBST(HAVE_RCUPDATE_WAIT_H, define) +else + AC_MSG_RESULT(no) + AC_SUBST(HAVE_RCUPDATE_WAIT_H, undef) +fi + AC_MSG_CHECKING([kernel source for struct net_generic]) if test -f $ksourcedir/include/net/netns/generic.h && \ $GREP -q 'struct net_generic' $ksourcedir/include/net/netns/generic.h; then diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in index 8878da9a..3a0e0b41 100644 --- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in +++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in @@ -70,6 +70,7 @@ #@HAVE_EAGAIN_IN_NFNETLINK_UNICAST@ HAVE_EAGAIN_IN_NFNETLINK_UNICAST #@HAVE_NLMSG_UNICAST@ HAVE_NLMSG_UNICAST #@HAVE_NF_BRIDGE_GET_PYSINDEV_NET@ HAVE_NF_BRIDGE_GET_PYSINDEV_NET +#@HAVE_RCUPDATE_WAIT_H@ HAVE_RCUPDATE_WAIT_H #ifdef HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H #include @@ -168,6 +169,7 @@ do { \ #endif #endif +#ifndef HAVE_RCUPDATE_WAIT_H #ifndef HAVE_COND_RESCHED_RCU static inline void cond_resched_rcu(void) { @@ -178,6 +180,7 @@ static inline void cond_resched_rcu(void) #endif } #endif +#endif #if defined(CONFIG_NETFILTER_NETLINK) || defined(CONFIG_NETFILTER_NETLINK_MODULE) #else diff --git a/kernel/net/netfilter/ipset/ip_set_bitmap_gen.h b/kernel/net/netfilter/ipset/ip_set_bitmap_gen.h index 3245b6b2..9db4db91 100644 --- a/kernel/net/netfilter/ipset/ip_set_bitmap_gen.h +++ b/kernel/net/netfilter/ipset/ip_set_bitmap_gen.h @@ -5,6 +5,10 @@ #ifndef __IP_SET_BITMAP_IP_GEN_H #define __IP_SET_BITMAP_IP_GEN_H +#ifdef HAVE_RCUPDATE_WAIT_H +#include +#endif + #define mtype_do_test IPSET_TOKEN(MTYPE, _do_test) #define mtype_gc_test IPSET_TOKEN(MTYPE, _gc_test) #define mtype_is_filled IPSET_TOKEN(MTYPE, _is_filled) diff --git a/kernel/net/netfilter/ipset/ip_set_hash_gen.h b/kernel/net/netfilter/ipset/ip_set_hash_gen.h index 76c3894e..0ebe3bed 100644 --- a/kernel/net/netfilter/ipset/ip_set_hash_gen.h +++ b/kernel/net/netfilter/ipset/ip_set_hash_gen.h @@ -6,6 +6,9 @@ #define _IP_SET_HASH_GEN_H #include +#ifdef HAVE_RCUPDATE_WAIT_H +#include +#endif #include #include #include -- 2.47.2