PERFORCE change 153229 for review

Christian S.J. Peron csjp at FreeBSD.org
Wed Nov 19 11:06:15 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=153229

Change 153229 by csjp at hvm02 on 2008/11/19 19:05:15

	Add a method to garbage collect all caches.

Affected files ...

.. //depot/projects/trustedbsd/bsmtrace/fcache.c#2 edit

Differences ...

==== //depot/projects/trustedbsd/bsmtrace/fcache.c#2 (text+ko) ====

@@ -48,6 +48,24 @@
 }
 
 void
+fcache_destroy(void)
+{
+	struct fcache *fcp, *next_fcp;
+	struct dev_list *dp, *dp2;
+
+	TAILQ_FOREACH_SAFE(dp, &cache_head, d_glue, dp2) {
+		for (fcp = RB_MIN(btree, &dp->d_btree); fcp != NULL;
+		    fcp = next_fcp) {
+			next_fcp = RB_NEXT(btree, &dp->d_btree, fcp);
+			RB_REMOVE(btree, &dp->d_btree, fcp);
+			free(fcp);
+		}
+		TAILQ_REMOVE(&cache_head, dp, d_glue);
+		free(dp);
+	}
+}
+
+void
 fcache_init(void)
 {
 


More information about the p4-projects mailing list