Date: Wed, 19 Nov 2008 19:17:26 GMT From: "Christian S.J. Peron" <csjp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 153232 for review Message-ID: <200811191917.mAJJHQ30052802@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=153232 Change 153232 by csjp@hvm02 on 2008/11/19 19:17:14 Mark internal functions as static, create prototypes for the methods that will be consumed by external code. Add a comment that we will require an eviction staregy when we are adding the cache entry. Affected files ... .. //depot/projects/trustedbsd/bsmtrace/fcache.c#3 edit .. //depot/projects/trustedbsd/bsmtrace/fcache.h#2 edit .. //depot/projects/trustedbsd/bsmtrace/includes.h#3 edit Differences ... ==== //depot/projects/trustedbsd/bsmtrace/fcache.c#3 (text+ko) ==== @@ -28,7 +28,6 @@ * SUCH DAMAGE. */ #include "includes.h" -#include "fcache.h" static int fcache_cmp(struct fcache *, struct fcache *); @@ -72,7 +71,7 @@ TAILQ_INIT(&cache_head); } -struct dev_list * +static struct dev_list * fcache_locate(dev_t device) { struct dev_list *dp; @@ -104,12 +103,15 @@ return (fcp->f_pathname); } -static void +void fache_add_entry(dev_t device, ino_t inode, char *pathname) { struct dev_list *dp; struct fcache *fcp; + /* + * NB: We need an eviction strategy here. + */ dp = fcache_locate(device); if (dp == NULL) { (void) fprintf(stderr, "failed to allocate cache\n"); ==== //depot/projects/trustedbsd/bsmtrace/fcache.h#2 (text+ko) ==== @@ -42,4 +42,9 @@ RB_HEAD(btree, fcache) d_btree; }; +void fcache_destroy(void); +void fcache_init(void); +char *fcache_search(dev_t, ino_t); +void fache_add_entry(dev_t, ino_t, char *); + #endif /* FCACHE_DOT_H_ */ ==== //depot/projects/trustedbsd/bsmtrace/includes.h#3 (text+ko) ==== @@ -30,6 +30,7 @@ #include <sys/types.h> #ifndef __APPLE__ #include <sys/queue.h> +#include <sys/tree.h> #endif #include <sys/stat.h> #include <sys/param.h> @@ -67,6 +68,7 @@ #endif #include "config.h" #include "deuce.h" +#include "fcache.h" #include "bsmtrace.h" #include "conf.h" #include "bsm.h"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811191917.mAJJHQ30052802>