Date: Wed, 19 Nov 2008 19:06:14 GMT From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 153229 for review Message-ID: <200811191906.mAJJ6EZU051973@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=153229 Change 153229 by csjp@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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811191906.mAJJ6EZU051973>