home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / dnlc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  2.1 KB  |  85 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10.  
  11.  
  12.  
  13. #ifndef _SYS_DNLC_H
  14. #define _SYS_DNLC_H
  15.  
  16. #ident    "@(#)/usr/include/sys/dnlc.h.sl 1.1 4.0 12/08/90 4130 AT&T-USL"
  17. /*
  18.  * This structure describes the elements in the cache of recent
  19.  * names looked up.
  20.  */
  21.  
  22. #define    NC_NAMLEN    15    /* maximum name segment length we bother with */
  23.  
  24. struct ncache {
  25.     struct ncache *hash_next;     /* hash chain, MUST BE FIRST */
  26.     struct ncache *hash_prev;
  27.     struct ncache *lru_next;     /* LRU chain */
  28.     struct ncache *lru_prev;
  29.     struct vnode *vp;        /* vnode the name refers to */
  30.     struct vnode *dp;        /* vnode of parent of name */
  31.     char namlen;            /* length of name */
  32.     char name[NC_NAMLEN];        /* segment name */
  33.     struct cred *cred;        /* credentials */
  34. };
  35.  
  36. /*
  37.  * Stats on usefulness of name cache.
  38.  */
  39. struct ncstats {
  40.     int    hits;        /* hits that we can really use */
  41.     int    misses;        /* cache misses */
  42.     int    enters;        /* number of enters done */
  43.     int    dbl_enters;    /* number of enters tried when already cached */
  44.     int    long_enter;    /* long names tried to enter */
  45.     int    long_look;    /* long names tried to look up */
  46.     int    lru_empty;    /* LRU list empty */
  47.     int    purges;        /* number of purges of cache */
  48. };
  49.  
  50. #define    ANYCRED    ((cred_t *) -1)
  51. #define    NOCRED    ((cred_t *) 0)
  52.  
  53. extern int        ncsize;
  54. extern struct ncache    *ncache;
  55.  
  56. /*
  57.  * External routines.
  58.  */
  59.  
  60. #if defined(__STDC__)
  61.  
  62. void    dnlc_init(void);
  63. void    dnlc_enter(vnode_t *, char *, vnode_t *, cred_t *);
  64. vnode_t    *dnlc_lookup(vnode_t *, char *, cred_t *);
  65. void    dnlc_purge(void);
  66. int    dnlc_purge1(void);
  67. void    dnlc_purge_vp(vnode_t *);
  68. int    dnlc_purge_vfsp(vfs_t *, int);
  69. void    dnlc_remove(vnode_t *, char *);
  70.  
  71. #else
  72.  
  73. void    dnlc_init();
  74. void    dnlc_enter();
  75. vnode_t    *dnlc_lookup();
  76. void    dnlc_purge();
  77. int    dnlc_purge1();
  78. void    dnlc_purge_vp();
  79. int    dnlc_purge_vfsp();
  80. void    dnlc_remove();
  81.  
  82. #endif
  83.  
  84. #endif    /* _SYS_DNLC_H */
  85.