home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / fs / namenode.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  1.7 KB  |  56 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. #ifndef _FS_NAMENODE_H
  11. #define _FS_NAMENODE_H
  12.  
  13. #ident    "@(#)/usr/include/sys/fs/namenode.h.sl 1.1 4.0 12/08/90 8578 AT&T-USL"
  14.  
  15. /*
  16.  * This structure is used to pass a file descriptor from user
  17.  * level to the kernel. It is first used by fattach() and then
  18.  * be NAMEFS.
  19.  */
  20. struct namefd {
  21.     int fd;
  22. };
  23.  
  24. /*
  25.  * Each NAMEFS object is identified by a struct namenode/vnode pair.
  26.  */
  27. struct namenode {
  28.     struct vnode    nm_vnode;    /* represents mounted file desc. */
  29.     ushort        nm_flag;    /* flags defined below */
  30.     struct vattr    nm_vattr;    /* attributes of mounted file desc. */
  31.     struct vnode    *nm_filevp;    /* file desc. prior to mounting */
  32.     struct file    *nm_filep;  /* file pointer of nm_filevp */
  33.     struct vnode    *nm_mountpt;    /* mount point prior to mounting */
  34.     struct namenode *nm_nextp;    /* next link in the linked list */
  35.     struct namenode *nm_backp;    /* back link in linked list */
  36. };
  37.  
  38. /*
  39.  * Valid flags for namenodes.
  40.  */
  41. #define NMLOCK        01    /* the namenode is locked */
  42. #define NMWANT        02    /* a process wants the namenode */
  43.  
  44.  
  45. /*
  46.  * Macros to convert a vnode to a namenode, and vice versa.
  47.  */
  48. #define VTONM(vp) ((struct namenode *)((vp)->v_data))
  49. #define NMTOV(nm) (&(nm)->nm_vnode)
  50.  
  51. extern struct namenode *namefind();
  52. extern struct namenode *namealloc;
  53. extern struct vnodeops nm_vnodeops;
  54.  
  55. #endif    /* _FS_NAMENODE_H */
  56.