1: /*
   2:  * The inode is the focus of
   3:  * file activity in unix. There is a unique
   4:  * inode allocated for each active file,
   5:  * each current directory, each mounted-on
   6:  * file, text file, and the root. An inode is 'named'
   7:  * by its dev/inumber pair. (iget/iget.c)
   8:  * Data, from mode on, is read in
   9:  * from permanent inode on volume.
  10:  */
  11: 
  12: #ifdef  UCB_NKB
  13: 
  14: #define NADDR   7
  15: #ifdef  MPX_FILS
  16: #define NINDEX  6
  17: #endif
  18: 
  19: #else   UCB_NKB
  20: 
  21: #define NADDR   13
  22: #ifdef  MPX_FILS
  23: #define NINDEX  15
  24: #endif	UCB_NKB
  25: 
  26: #endif
  27: 
  28: #ifdef  MPX_FILS
  29: struct group {
  30:     short   g_state;
  31:     char    g_index;
  32:     char    g_rot;
  33:     struct  group   *g_group;
  34:     struct  inode   *g_inode;
  35:     struct  file    *g_file;
  36:     short   g_rotmask;
  37:     short   g_datq;
  38:     struct  chan *g_chans[NINDEX];
  39: };
  40: #endif
  41: 
  42: struct  inode
  43: {
  44:     int i_flag;
  45:     int i_count;    /* reference count */
  46:     dev_t   i_dev;      /* device where inode resides */
  47:     ino_t   i_number;   /* i number, 1-to-1 with device address */
  48:     u_short i_mode;
  49:     short   i_nlink;    /* directory entries */
  50:     short   i_uid;      /* owner */
  51:     short   i_gid;      /* group of owner */
  52:     off_t   i_size;     /* size of file */
  53:     union {
  54:         struct {
  55:             daddr_t I_addr[NADDR];  /* if normal file/directory */
  56:             daddr_t I_lastr;    /* last logical block read (for read-ahead) */
  57:         } i_f;
  58: #define i_addr  i_f.I_addr
  59: #define i_lastr i_f.I_lastr
  60:         struct  {
  61:             daddr_t I_rdev;     /* i_addr[0] */
  62: #define i_rdev  i_d.I_rdev
  63: #ifdef  MPX_FILS
  64:             struct  group I_group;  /* multiplexor group file */
  65: #define i_group i_d.I_group
  66: #endif
  67:         } i_d;
  68: #ifdef  UCB_QUOTAS
  69:         struct  {
  70:             daddr_t I_qused;
  71:             daddr_t I_qmax;
  72:         } i_q;
  73: #define i_qused i_q.I_qused
  74: #define i_qmax  i_q.I_qmax
  75: #endif
  76:     } i_un;
  77: #ifdef  UCB_QUOTAS
  78:     struct inode    *i_quot;/* pointer to quota inode */
  79: #endif
  80: #ifdef  UCB_IHASH
  81:     struct  inode *i_link;  /* link in hash chain (iget/iput/ifind) */
  82: #endif
  83: };
  84: 
  85: 
  86: #ifdef  KERNEL
  87: extern struct inode inode[];    /* The inode table itself */
  88: #ifdef  MPX_FILS
  89: struct inode *mpxip;        /* mpx virtual inode */
  90: #endif
  91: #endif
  92: 
  93: /* flags */
  94: #define ILOCK   01      /* inode is locked */
  95: #define IUPD    02      /* file has been modified */
  96: #define IACC    04      /* inode access time to be updated */
  97: #define IMOUNT  010     /* inode is mounted on */
  98: #define IWANT   020     /* some process waiting on lock */
  99: #define ITEXT   040     /* inode is pure text prototype */
 100: #define ICHG    0100        /* inode has been changed */
 101: #define IPIPE   0200        /* inode is a pipe */
 102: #ifdef  UCB_QUOTAS
 103: #define IQUOT   0400        /* directory that has original quota pointer */
 104: #endif
 105: 
 106: /* modes */
 107: #define IFMT    0170000     /* type of file */
 108: #define     IFDIR   0040000 /* directory */
 109: #define     IFCHR   0020000 /* character special */
 110: #define     IFMPC   0030000 /* multiplexed char special */
 111: #define     IFBLK   0060000 /* block special */
 112: #define     IFMPB   0070000 /* multiplexed block special */
 113: #define     IFREG   0100000 /* regular */
 114: #define     IFLNK   0120000 /* symbolic link */
 115: #define     IFQUOT  0140000 /* quota */
 116: #define ISUID   04000       /* set user id on execution */
 117: #define ISGID   02000       /* set group id on execution */
 118: #define ISVTX   01000       /* save swapped text even after use */
 119: #define IREAD   0400        /* read, write, execute permissions */
 120: #define IWRITE  0200
 121: #define IEXEC   0100
 122: 
 123: #ifdef  UCB_GRPMAST
 124: #define grpmast()   (u.u_uid == u.u_gid)
 125: #endif

Defined variables

mpxip defined in line 89; used 13 times

Defined struct's

group defined in line 29; used 78 times
inode defined in line 42; used 245 times

Defined macros

IEXEC defined in line 121; used 7 times
IFQUOT defined in line 115; used 6 times
IMOUNT defined in line 97; used 4 times
IPIPE defined in line 101; used 4 times
IQUOT defined in line 103; used 2 times
IREAD defined in line 119; used 6 times
ISGID defined in line 117; used 5 times
ISUID defined in line 116; used 5 times
IWANT defined in line 98; used 5 times
NINDEX defined in line 23; used 9 times
grpmast defined in line 124; used 2 times
i_group defined in line 65; used 4 times
i_lastr defined in line 59; used 3 times
i_qmax defined in line 74; used 2 times
i_qused defined in line 73; used 9 times

Usage of this include

inode.h used 66 times
Last modified: 1983-09-06
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1181
Valid CSS Valid XHTML 1.0 Strict