summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/mld6.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2009-07-19 14:20:53 +0000
committerrwatson <rwatson@FreeBSD.org>2009-07-19 14:20:53 +0000
commit69550679325e630b5720649bc0f8787e31161476 (patch)
tree3bd297fbee234a2e1c20d56c0d53370c6ab32793 /sys/netinet6/mld6.c
parentc70ad2698e22375c9f47db2c3e6a5ee7f3fc937c (diff)
downloadFreeBSD-src-69550679325e630b5720649bc0f8787e31161476.zip
FreeBSD-src-69550679325e630b5720649bc0f8787e31161476.tar.gz
Reimplement and/or implement vnet list locking by replacing a mostly
unused custom mutex/condvar-based sleep locks with two locks: an rwlock (for non-sleeping use) and sxlock (for sleeping use). Either acquired for read is sufficient to stabilize the vnet list, but both must be acquired for write to modify the list. Replace previous no-op read locking macros, used in various places in the stack, with actual locking to prevent race conditions. Callers must declare when they may perform unbounded sleeps or not when selecting how to lock. Refactor vnet sysinits so that the vnet list and locks are initialized before kernel modules are linked, as the kernel linker will use them for modules loaded by the boot loader. Update various consumers of these KPIs based on whether they may sleep or not. Reviewed by: bz Approved by: re (kib)
Diffstat (limited to 'sys/netinet6/mld6.c')
-rw-r--r--sys/netinet6/mld6.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c
index 9d69e11..4b69da2 100644
--- a/sys/netinet6/mld6.c
+++ b/sys/netinet6/mld6.c
@@ -1306,13 +1306,13 @@ mld_fasttimo(void)
{
VNET_ITERATOR_DECL(vnet_iter);
- VNET_LIST_RLOCK();
+ VNET_LIST_RLOCK_NOSLEEP();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
mld_fasttimo_vnet();
CURVNET_RESTORE();
}
- VNET_LIST_RUNLOCK();
+ VNET_LIST_RUNLOCK_NOSLEEP();
}
/*
@@ -1721,13 +1721,13 @@ mld_slowtimo(void)
{
VNET_ITERATOR_DECL(vnet_iter);
- VNET_LIST_RLOCK();
+ VNET_LIST_RLOCK_NOSLEEP();
VNET_FOREACH(vnet_iter) {
CURVNET_SET(vnet_iter);
mld_slowtimo_vnet();
CURVNET_RESTORE();
}
- VNET_LIST_RUNLOCK();
+ VNET_LIST_RUNLOCK_NOSLEEP();
}
/*
OpenPOWER on IntegriCloud