Index: kern_mac.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_mac.c,v retrieving revision 1.113 diff -u -r1.113 kern_mac.c --- kern_mac.c 15 Jul 2004 08:26:05 -0000 1.113 +++ kern_mac.c 30 Oct 2004 13:53:09 -0000 @@ -188,6 +188,9 @@ { #ifndef MAC_STATIC + if (!late) + return; + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "mac_policy_grab_exclusive() at %s:%d", __FILE__, __LINE__); mtx_lock(&mac_policy_mtx); @@ -201,6 +204,9 @@ { #ifndef MAC_STATIC + if (!late) + return; + mtx_assert(&mac_policy_mtx, MA_OWNED); KASSERT(mac_policy_count == 0, ("mac_policy_assert_exclusive(): not exclusive")); @@ -212,6 +218,9 @@ { #ifndef MAC_STATIC + if (!late) + return; + KASSERT(mac_policy_count == 0, ("mac_policy_release_exclusive(): not exclusive")); mtx_unlock(&mac_policy_mtx); @@ -224,6 +233,9 @@ { #ifndef MAC_STATIC + if (!late) + return; + mtx_lock(&mac_policy_mtx); mac_policy_count++; mtx_unlock(&mac_policy_mtx); @@ -236,6 +248,9 @@ #ifndef MAC_STATIC int ret; + if (!late) + return; + mtx_lock(&mac_policy_mtx); if (!LIST_EMPTY(&mac_policy_list)) { mac_policy_count++; @@ -245,6 +260,9 @@ mtx_unlock(&mac_policy_mtx); return (ret); #else + if (!late) + return; + return (1); #endif } @@ -254,6 +272,9 @@ { #ifndef MAC_STATIC + if (!late) + return; + mtx_lock(&mac_policy_mtx); mac_policy_count--; KASSERT(mac_policy_count >= 0, ("MAC_POLICY_LIST_LOCK"));