PERFORCE change 93358 for review
Todd Miller
millert at FreeBSD.org
Wed Mar 15 19:23:57 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=93358
Change 93358 by millert at millert_p3 on 2006/03/15 19:23:08
Convert policy lock from sx lock to rw lock. We can't use
an sx lock since the proc lock is held and you are not
allowed to hold a mutex while getting an sx lock. It looks
like an rw lock is what was desired in the first place but
they were not available at the time.
Affected files ...
.. //depot/projects/trustedbsd/sebsd/sys/security/sebsd/ss/services.c#12 edit
Differences ...
==== //depot/projects/trustedbsd/sebsd/sys/security/sebsd/ss/services.c#12 (text+ko) ====
@@ -39,16 +39,16 @@
#ifdef _KERNEL
-#include <sys/sx.h>
+#include <sys/rwlock.h>
#include <sys/proc.h>
-static struct sx policy_rwlock;
-#define POLICY_RDLOCK sx_slock(&policy_rwlock)
-#define POLICY_WRLOCK sx_xlock(&policy_rwlock)
-#define POLICY_RDUNLOCK sx_sunlock(&policy_rwlock)
-#define POLICY_WRUNLOCK sx_xunlock(&policy_rwlock)
+static struct rwlock policy_rwlock;
+#define POLICY_RDLOCK rw_rlock(&policy_rwlock)
+#define POLICY_WRLOCK rw_wlock(&policy_rwlock)
+#define POLICY_RDUNLOCK rw_runlock(&policy_rwlock)
+#define POLICY_WRUNLOCK rw_wunlock(&policy_rwlock)
-SX_SYSINIT(policy_rwlock, &policy_rwlock, "SEBSD policy lock");
+RW_SYSINIT(policy_rwlock, &policy_rwlock, "SEBSD policy lock");
static struct mtx load_sem;
#define LOAD_LOCK mtx_lock(&load_sem)
More information about the trustedbsd-cvs
mailing list