Author: jah
Date: Sat Apr  4 04:03:10 2020
New Revision: 359628
URL: https://svnweb.freebsd.org/changeset/base/359628

Log:
  mac_policy: Remove mac_policy_sx
  
  This lock was made unnecessary by the addition of mac_policy_rms in r356120.
  
  Reviewed by:  mjg, kib
  Differential Revision:        https://reviews.freebsd.org/D24283

Modified:
  head/sys/security/mac/mac_framework.c

Modified: head/sys/security/mac/mac_framework.c
==============================================================================
--- head/sys/security/mac/mac_framework.c       Sat Apr  4 00:56:56 2020        
(r359627)
+++ head/sys/security/mac/mac_framework.c       Sat Apr  4 04:03:10 2020        
(r359628)
@@ -184,7 +184,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary lab
  * 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_rm, is acquired over policy entry points that will never sleep;
- * the other, mac_policy_sx, is acquire over policy entry points that may
+ * the other, mac_policy_rms, is acquired 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,
  * etc.  The latter will tend to involve potentially blocking memory
@@ -192,8 +192,7 @@ MALLOC_DEFINE(M_MACTEMP, "mactemp", "MAC temporary lab
  */
 #ifndef MAC_STATIC
 static struct rmlock mac_policy_rm;    /* Non-sleeping entry points. */
-static struct sx mac_policy_sx;                /* Sleeping entry points. */
-static struct rmslock mac_policy_rms;
+static struct rmslock mac_policy_rms;  /* Sleeping entry points. */
 #endif
 
 struct mac_policy_list_head mac_policy_list;
@@ -266,7 +265,6 @@ mac_policy_xlock(void)
        if (!mac_late)
                return;
 
-       sx_xlock(&mac_policy_sx);
        rms_wlock(&mac_policy_rms);
        rm_wlock(&mac_policy_rm);
 #endif
@@ -282,7 +280,6 @@ mac_policy_xunlock(void)
 
        rm_wunlock(&mac_policy_rm);
        rms_wunlock(&mac_policy_rms);
-       sx_xunlock(&mac_policy_sx);
 #endif
 }
 
@@ -294,8 +291,7 @@ mac_policy_xlock_assert(void)
        if (!mac_late)
                return;
 
-       /* XXXRW: rm_assert(&mac_policy_rm, RA_WLOCKED); */
-       sx_assert(&mac_policy_sx, SA_XLOCKED);
+       rm_assert(&mac_policy_rm, RA_WLOCKED);
 #endif
 }
 
@@ -313,7 +309,6 @@ mac_init(void)
 #ifndef MAC_STATIC
        rm_init_flags(&mac_policy_rm, "mac_policy_rm", RM_NOWITNESS |
            RM_RECURSE);
-       sx_init_flags(&mac_policy_sx, "mac_policy_sx", SX_NOWITNESS);
        rms_init(&mac_policy_rms, "mac_policy_rms");
 #endif
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to