aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-08-11 08:31:40 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-08-11 08:31:40 +0000
commitb453d3d239d0dddd47740530389be1ceb70d9566 (patch)
treefa04aee802f2e579ed2aad91311ad591f8ddede8
parent8a0917c35b7cea1cd935ad5dca86c1ee0f58b2e0 (diff)
downloadsrc-b453d3d239d0dddd47740530389be1ceb70d9566.tar.gz
src-b453d3d239d0dddd47740530389be1ceb70d9566.zip
Use a static initializer for the multicast free tasks.
This makes the SYSINIT() function updated in r364072 superfluous. Suggested by: glebius@ MFC after: 1 week Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=364102
-rw-r--r--sys/netinet/in_mcast.c9
-rw-r--r--sys/netinet6/in6_mcast.c9
2 files changed, 2 insertions, 16 deletions
diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c
index cf624e8a3157..99efb4bdb3e4 100644
--- a/sys/netinet/in_mcast.c
+++ b/sys/netinet/in_mcast.c
@@ -229,16 +229,9 @@ inm_is_ifp_detached(const struct in_multi *inm)
* dedicated thread to avoid deadlocks when draining inm_release tasks.
*/
TASKQUEUE_DEFINE_THREAD(inm_free);
-static struct task inm_free_task;
static struct in_multi_head inm_free_list = SLIST_HEAD_INITIALIZER();
static void inm_release_task(void *arg __unused, int pending __unused);
-
-static void
-inm_init(void *arg __unused)
-{
- TASK_INIT(&inm_free_task, 0, inm_release_task, NULL);
-}
-SYSINIT(inm_init, SI_SUB_TASKQ, SI_ORDER_ANY, inm_init, NULL);
+static struct task inm_free_task = TASK_INITIALIZER(0, inm_release_task, NULL);
void
inm_release_wait(void *arg __unused)
diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c
index 2433dc2ee194..fde7e5dad165 100644
--- a/sys/netinet6/in6_mcast.c
+++ b/sys/netinet6/in6_mcast.c
@@ -516,16 +516,9 @@ in6m_release(struct in6_multi *inm)
* dedicated thread to avoid deadlocks when draining in6m_release tasks.
*/
TASKQUEUE_DEFINE_THREAD(in6m_free);
-static struct task in6m_free_task;
static struct in6_multi_head in6m_free_list = SLIST_HEAD_INITIALIZER();
static void in6m_release_task(void *arg __unused, int pending __unused);
-
-static void
-in6m_init(void *arg __unused)
-{
- TASK_INIT(&in6m_free_task, 0, in6m_release_task, NULL);
-}
-SYSINIT(in6m_init, SI_SUB_TASKQ, SI_ORDER_ANY, in6m_init, NULL);
+static struct task in6m_free_task = TASK_INITIALIZER(0, in6m_release_task, NULL);
void
in6m_release_list_deferred(struct in6_multi_head *inmh)