h/inode.h

06550 /* 06551 * The I node is the focus of all 06552 * file activity in unix. There is a unique 06553 * inode allocated for each active file, 06554 * each current directory, each mounted-on 06555 * file, text file, and the root. An inode is 'named' 06556 * by its dev/inumber pair. (iget/iget.c) 06557 * Data, from mode on, is read in 06558 * from permanent inode on volume. 06559 */ 06560 06561 #define NADDR 13 06562 #define NINDEX 15 06563 06564 struct group { 06565 short g_state; 06566 char g_index; 06567 char g_rot; 06568 struct group *g_group; 06569 struct inode *g_inode; 06570 struct file *g_file; 06571 short g_rotmask; 06572 short g_datq; 06573 struct chan *g_chans[NINDEX]; 06574 }; 06575 struct inode 06576 { 06577 char i_flag; 06578 char i_count; /* reference count */ 06579 dev_t i_dev; /* device where inode resides */ 06580 ino_t i_number; /* i number, 1-to-1 with device address */ 06581 unsigned short i_mode; 06582 short i_nlink; /* directory entries */ 06583 short i_uid; /* owner */ 06584 short i_gid; /* group of owner */ 06585 off_t i_size; /* size of file */ 06586 union { 06587 struct { 06588 daddr_t i_addr[NADDR]; /* if normal file/directory */ 06589 daddr_t i_lastr; /* last logical block read (for read-ahead) */ 06590 }; 06591 struct { 06592 daddr_t i_rdev; /* i_addr[0] */ 06593 struct group i_group; /* multiplexor group file */ 06594 }; 06595 } i_un; 06596 }; 06597 06598 06599 extern struct inode inode[]; /* The inode table itself */ 06600 struct inode *mpxip; /* mpx virtual inode */ 06601 06602 /* flags */ 06603 #define ILOCK 01 /* inode is locked */ 06604 #define IUPD 02 /* file has been modified */ 06605 #define IACC 04 /* inode access time to be updated */ 06606 #define IMOUNT 010 /* inode is mounted on */ 06607 #define IWANT 020 /* some process waiting on lock */ 06608 #define ITEXT 040 /* inode is pure text prototype */ 06609 #define ICHG 0100 /* inode has been changed */ 06610 06611 /* modes */ 06612 #define IFMT 0170000 /* type of file */ 06613 #define IFDIR 0040000 /* directory */ 06614 #define IFCHR 0020000 /* character special */ 06615 #define IFBLK 0060000 /* block special */ 06616 #define IFREG 0100000 /* regular */ 06617 #define IFMPC 0030000 /* multiplexed char special */ 06618 #define IFMPB 0070000 /* multiplexed block special */ 06619 #define ISUID 04000 /* set user id on execution */ 06620 #define ISGID 02000 /* set group id on execution */ 06621 #define ISVTX 01000 /* save swapped text even after use */ 06622 #define IREAD 0400 /* read, write, execute permissions */ 06623 #define IWRITE 0200 06624 #define IEXEC 0100 06625 06626 06627 06628 06629 06630 06631 06632 06633 06634 06635 06636 06637 06638 06639 06640 06641 06642 06643 06644 06645 06646 06647 06648 06649