diff options
Diffstat (limited to 'sys/security/mac/mac_framework.c')
-rw-r--r-- | sys/security/mac/mac_framework.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys/security/mac/mac_framework.c b/sys/security/mac/mac_framework.c index 1806e4a15b10..6a36b6bbdd02 100644 --- a/sys/security/mac/mac_framework.c +++ b/sys/security/mac/mac_framework.c @@ -78,7 +78,7 @@ __FBSDID("$FreeBSD$"); #include <sys/lock.h> #include <sys/mac.h> #include <sys/module.h> -#include <sys/rwlock.h> +#include <sys/rmlock.h> #include <sys/sdt.h> #include <sys/sx.h> #include <sys/systm.h> @@ -165,7 +165,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary label storage"); * * The dynamic policy list is protected by two locks: modifying the list * requires both locks to be held exclusively. One of the locks, - * mac_policy_rw, is acquired over policy entry points that will never sleep; + * mac_policy_rm, is acquired over policy entry points that will never sleep; * the other, mac_policy_sx, is acquire over policy entry points that may * sleep. The former category will be used when kernel locks may be held * over calls to the MAC Framework, during network processing in ithreads, @@ -173,7 +173,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary label storage"); * allocations, extended attribute I/O, etc. */ #ifndef MAC_STATIC -static struct rwlock mac_policy_rw; /* Non-sleeping entry points. */ +static struct rmlock mac_policy_rm; /* Non-sleeping entry points. */ static struct sx mac_policy_sx; /* Sleeping entry points. */ #endif @@ -185,14 +185,14 @@ static void mac_policy_xlock_assert(void); static void mac_policy_xunlock(void); void -mac_policy_slock_nosleep(void) +mac_policy_slock_nosleep(struct rm_priotracker *tracker) { #ifndef MAC_STATIC if (!mac_late) return; - rw_rlock(&mac_policy_rw); + rm_rlock(&mac_policy_rm, tracker); #endif } @@ -212,14 +212,14 @@ mac_policy_slock_sleep(void) } void -mac_policy_sunlock_nosleep(void) +mac_policy_sunlock_nosleep(struct rm_priotracker *tracker) { #ifndef MAC_STATIC if (!mac_late) return; - rw_runlock(&mac_policy_rw); + rm_runlock(&mac_policy_rm, tracker); #endif } @@ -247,7 +247,7 @@ mac_policy_xlock(void) return; sx_xlock(&mac_policy_sx); - rw_wlock(&mac_policy_rw); + rm_wlock(&mac_policy_rm); #endif } @@ -259,7 +259,7 @@ mac_policy_xunlock(void) if (!mac_late) return; - rw_wunlock(&mac_policy_rw); + rm_wunlock(&mac_policy_rm); sx_xunlock(&mac_policy_sx); #endif } @@ -272,7 +272,7 @@ mac_policy_xlock_assert(void) if (!mac_late) return; - rw_assert(&mac_policy_rw, RA_WLOCKED); + /* XXXRW: rm_assert(&mac_policy_rm, RA_WLOCKED); */ sx_assert(&mac_policy_sx, SA_XLOCKED); #endif } @@ -289,7 +289,7 @@ mac_init(void) mac_labelzone_init(); #ifndef MAC_STATIC - rw_init(&mac_policy_rw, "mac_policy_rw"); + rm_init(&mac_policy_rm, "mac_policy_rm", 0); sx_init(&mac_policy_sx, "mac_policy_sx"); #endif } |