Annotation of 3BSD/sys/h/inode.h, revision 1.1.1.1

1.1       root        1: /*     inode.h 2.1     1/5/80  */
                      2: 
                      3: /*
                      4:  * The I node is the focus of all
                      5:  * file activity in unix. There is a unique
                      6:  * inode allocated for each active file,
                      7:  * each current directory, each mounted-on
                      8:  * file, text file, and the root. An inode is 'named'
                      9:  * by its dev/inumber pair. (iget/iget.c)
                     10:  * Data, from mode on, is read in
                     11:  * from permanent inode on volume.
                     12:  */
                     13: 
                     14: #define        NADDR   13
                     15: 
                     16: #define        NINDEX          15
                     17: struct group
                     18: {
                     19:        short   g_state;
                     20:        char    g_index;
                     21:        char    g_rot;
                     22:        struct  group   *g_group;
                     23:        struct  inode   *g_inode;
                     24:        struct  file    *g_file;
                     25:        short   g_rotmask;
                     26:        short   g_datq;
                     27:        struct  chan *g_chans[NINDEX];
                     28: };
                     29: struct inode
                     30: {
                     31:        char    i_flag;
                     32:        char    i_count;        /* reference count */
                     33:        dev_t   i_dev;          /* device where inode resides */
                     34:        ino_t   i_number;       /* i number, 1-to-1 with device address */
                     35:        unsigned short i_mode;
                     36:        short   i_nlink;        /* directory entries */
                     37:        short   i_uid;          /* owner */
                     38:        short   i_gid;          /* group of owner */
                     39:        off_t   i_size;         /* size of file */
                     40:        union {
                     41:                struct {
                     42:                        daddr_t i_addr[NADDR];  /* if normal file/directory */
                     43:                        daddr_t i_lastr;        /* last logical block read (for read-ahead) */
                     44:                };
                     45:                struct {
                     46:                        daddr_t i_rdev;         /* i_addr[0] */
                     47:                        struct  group i_group;  /* multiplexor group file */
                     48:                };
                     49:        } i_un;
                     50:        short   i_vfdcnt;       /* number of fd's vreading this inode */
                     51: };
                     52: 
                     53: #ifdef KERNEL
                     54: extern struct inode inode[];   /* The inode table itself */
                     55: 
                     56: struct inode *rootdir;         /* pointer to inode of root directory */
                     57: struct inode *mpxip;           /* mpx virtual inode */
                     58: 
                     59: struct inode *ialloc();
                     60: struct inode *iget();
                     61: struct inode *owner();
                     62: struct inode *maknode();
                     63: struct inode *namei();
                     64: #endif
                     65: 
                     66: /* flags */
                     67: #define        ILOCK   01              /* inode is locked */
                     68: #define        IUPD    02              /* file has been modified */
                     69: #define        IACC    04              /* inode access time to be updated */
                     70: #define        IMOUNT  010             /* inode is mounted on */
                     71: #define        IWANT   020             /* some process waiting on lock */
                     72: #define        ITEXT   040             /* inode is pure text prototype */
                     73: #define        ICHG    0100            /* inode has been changed */
                     74: 
                     75: /* modes */
                     76: #define        IFMT    0170000         /* type of file */
                     77: #define                IFDIR   0040000 /* directory */
                     78: #define                IFCHR   0020000 /* character special */
                     79: #define                IFBLK   0060000 /* block special */
                     80: #define                IFREG   0100000 /* regular */
                     81: #define                IFMPC   0030000 /* multiplexed char special */
                     82: #define                IFMPB   0070000 /* multiplexed block special */
                     83: #define        ISUID   04000           /* set user id on execution */
                     84: #define        ISGID   02000           /* set group id on execution */
                     85: #define        ISVTX   01000           /* save swapped text even after use */
                     86: #define        IREAD   0400            /* read, write, execute permissions */
                     87: #define        IWRITE  0200
                     88: #define        IEXEC   0100

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.