Date: Thu, 31 Jul 2003 19:19:45 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 35307 for review Message-ID: <200308010219.h712JjU4028265@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=35307 Change 35307 by rwatson@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 }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308010219.h712JjU4028265>
