Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Mar 2006 19:23:40 GMT
From:      Todd Miller <millert@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 93358 for review
Message-ID:  <200603151923.k2FJNeQh079180@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=93358

Change 93358 by millert@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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603151923.k2FJNeQh079180>