PERFORCE change 14758 for review

Robert Watson rwatson at freebsd.org
Tue Jul 23 04:10:25 GMT 2002


http://people.freebsd.org/~peter/p4db/chv.cgi?CH=14758

Change 14758 by rwatson at rwatson_paprika on 2002/07/22 21:09:35

	Correctly spell VCACHEDLABEL due to a mismerge.
	
	Modify cache hit measurement to handle all cases not just the
	EA case, since that's no longer accurate.  I'll export them
	from sysctls tomorrow.

Affected files ...

.. //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#188 edit

Differences ...

==== //depot/projects/trustedbsd/mac/sys/kern/kern_mac.c#188 (text+ko) ====

@@ -134,14 +134,8 @@
 TUNABLE_INT("security.mac.cache_fslabel_in_vnode",
     &mac_cache_fslabel_in_vnode);
 
-static unsigned int	mac_ea_cache_hits = 0;
-SYSCTL_UINT(_security_mac, OID_AUTO, ea_cache_hits, CTLFLAG_RD,
-    &mac_ea_cache_hits, 0,
-    "How often cached label can be used for EA backing");
-static unsigned int	mac_ea_cache_misses = 0;
-SYSCTL_UINT(_security_mac, OID_AUTO, ea_cache_misses, CTLFLAG_RD,
-    &mac_ea_cache_misses, 0,
-    "How often cached label cannot be used for EA backing");
+static int	mac_vnode_label_cache_hit = 0;
+static int	mac_vnode_label_cache_miss = 0;
 
 static int	error_select(int error1, int error2);
 static int	mac_externalize(struct label *label, struct mac *mac);
@@ -973,12 +967,6 @@
 
 	ASSERT_VOP_LOCKED(vp, "vop_stdrefreshlabel_ea");
 
-	if (vp->v_flag & VCACHEDLABEL) {
-		mac_ea_cache_hits++;
-		return (0);
-	} else
-		mac_ea_cache_misses++;
-
 	/*
 	 * Call out to external policies first.  Order doesn't really
 	 * matter, as long as failure of one assures failure of all.
@@ -1067,8 +1055,11 @@
 		return (EBADF);
 	}
 
-	if (mac_cache_fslabel_in_vnode)
+	if (vp->v_flag & VCACHEDLABEL) {
+		mac_vnode_label_cache_hit++;
 		return (0);
+	} else
+		mac_vnode_label_cache_miss++;
 
 	if ((vp->v_mount->mnt_flag & MNT_MULTILABEL) == 0) {
 		mac_update_vnode_from_mount(vp, vp->v_mount);
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