PERFORCE change 35307 for review
Robert Watson
rwatson at FreeBSD.org
Fri Aug 1 02:19:45 GMT 2003
http://perforce.freebsd.org/chv.cgi?CH=35307
Change 35307 by rwatson at rwatson_tislabs on 2003/07/31 19:19:45
Attempt to de-interlace ifdef'd code in the name of readability.
Affected files ...
.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#396 edit
Differences ...
==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#396 (text+ko) ====
@@ -121,7 +121,6 @@
*/
static int ea_warn_once = 0;
-#ifndef MAC_ALWAYS_LABEL_MBUF
/*
* Flag to indicate whether or not we should allocate label storage for
* new mbufs. Since most dynamic policies we currently work with don't
@@ -133,6 +132,7 @@
* already has to deal with uninitialized labels, this probably won't
* be a problem. Note: currently no locking. Will this be a problem?
*/
+#ifndef MAC_ALWAYS_LABEL_MBUF
static int mac_labelmbufs = 0;
#endif
@@ -520,36 +520,28 @@
/*
* After the policy list has changed, walk the list to update any global
- * flags.
+ * flags. Currently, we support only one flag, and it's conditionally
+ * defined; as a result, the entire function is conditional. Eventually,
+ * the #else case might also iterate across the policies.
*/
static void
mac_policy_updateflags(void)
{
+#ifndef MAC_ALWAYS_LABEL_MBUF
struct mac_policy_conf *tmpc;
-#ifndef MAC_ALWAYS_LABEL_MBUF
int labelmbufs;
-#endif
mac_policy_assert_exclusive();
-#ifndef MAC_ALWAYS_LABEL_MBUF
labelmbufs = 0;
-#endif
-
LIST_FOREACH(tmpc, &mac_static_policy_list, mpc_list) {
-#ifndef MAC_ALWAYS_LABEL_MBUF
if (tmpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_LABELMBUFS)
labelmbufs++;
-#endif
}
LIST_FOREACH(tmpc, &mac_policy_list, mpc_list) {
-#ifndef MAC_ALWAYS_LABEL_MBUF
if (tmpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_LABELMBUFS)
labelmbufs++;
-#endif
}
-
-#ifndef MAC_ALWAYS_LABEL_MBUF
mac_labelmbufs = (labelmbufs != 0);
#endif
}
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list