OpenAFS
OpenAFS distributed network file system
|
00001 /* 00002 * Copyright 2000, International Business Machines Corporation and others. 00003 * All Rights Reserved. 00004 * 00005 * This software has been released under the terms of the IBM Public 00006 * License. For details, see the LICENSE file in the top-level source 00007 * directory or online at http://www.openafs.org/dl/license10.html 00008 */ 00009 00010 #include <ctype.h> 00011 00012 #define CM_AFSNCNAMESIZE 40 /* multiple of 8 (for 64-bit) */ 00013 #define NCSIZE 512 00014 #define NHSIZE 256 /* must be power of 2 */ 00015 00016 #define CM_DNLC_MAGIC ('D' | 'N' <<8 | 'L'<<16 | 'C'<<24) 00017 00018 typedef struct nc { 00019 afs_uint32 magic; 00020 unsigned int key; 00021 struct nc *next, *prev; 00022 cm_scache_t *dirp, *vp; 00023 normchar_t name[CM_AFSNCNAMESIZE]; 00024 } cm_nc_t; 00025 00026 typedef struct { 00027 afs_int32 enters, lookups, misses, removes; 00028 afs_int32 purgeds, purgevs, purgevols, purges; 00029 afs_int32 cycles, lookuprace; 00030 } cm_dnlcstats_t; 00031 00032 #define dnlcHash(ts, hval) for (hval=0; *ts; ts++) { \ 00033 hval *= 173; \ 00034 hval += cm_NormCharUpr(*ts); \ 00035 } 00036 extern void cm_dnlcEnter(cm_scache_t *adp, normchar_t *name, cm_scache_t *avc); 00037 extern void cm_dnlcRemove(cm_scache_t *adp, normchar_t *name); 00038 extern void cm_dnlcPurgedp(cm_scache_t *adp); 00039 extern void cm_dnlcPurgevp(cm_scache_t *avc); 00040 extern void cm_dnlcPurge(void); 00041 extern void cm_dnlcPurgeVol(struct AFSFid *fidp); 00042 extern void cm_dnlcInit(int); 00043 extern long cm_dnlcShutdown(void); 00044 extern cm_scache_t* cm_dnlcLookup(cm_scache_t *adp, cm_lookupSearch_t* sp); 00045 extern long cm_dnlcValidate(void);