windows-misc-20050102
[openafs.git] / src / WINNT / afsd / cm_dnlc.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #include <ctype.h>
11
12 #define         CM_AFSNCNAMESIZE        40  /* multiple of 8 (for 64-bit) */
13 #define         NCSIZE                  512
14 #define         NHSIZE                  256 /* must be power of 2 == CM_DIR_NHASHENT */
15
16
17 struct nc {
18   unsigned int key;
19   struct nc *next, *prev;
20   cm_scache_t *dirp, *vp;
21   unsigned char name[CM_AFSNCNAMESIZE];   
22 };
23
24 typedef struct {
25   unsigned int enters, lookups, misses, removes;
26   unsigned int purgeds, purgevs, purgevols, purges;
27   unsigned int cycles, lookuprace;
28 } cm_dnlcstats_t;
29
30 #define dnlcHash(ts, hval) for (hval=0; *ts; ts++) {    \
31                                 hval *= 173;            \
32                                 hval += cm_foldUpper[(unsigned char)(*ts)]; \
33                            }
34 extern void cm_dnlcEnter(cm_scache_t *adp, char *name, cm_scache_t *avc);
35 extern void cm_dnlcRemove(cm_scache_t *adp, char *name);
36 extern void cm_dnlcPurgedp(cm_scache_t *adp);
37 extern void cm_dnlcPurgevp(cm_scache_t *avc);
38 extern void cm_dnlcPurge(void);
39 extern void cm_dnlcPurgeVol(struct AFSFid *fidp);
40 extern void cm_dnlcInit(void);
41 extern void cm_dnlcShutdown(void);
42 extern cm_scache_t* cm_dnlcLookup(cm_scache_t *adp, cm_lookupSearch_t* sp);