Research V6 development
[unix-history] / usr / sys / inode.h
CommitLineData
86bf84ea
KT
1/*
2 * The I node is the focus of all
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 */
11struct inode
12{
13 char i_flag;
14 char i_count; /* reference count */
15 int i_dev; /* device where inode resides */
16 int i_number; /* i number, 1-to-1 with device address */
17 int i_mode;
18 char i_nlink; /* directory entries */
19 char i_uid; /* owner */
20 char i_gid; /* group of owner */
21 char i_size0; /* most significant of size */
22 char *i_size1; /* least sig */
23 int i_addr[8]; /* device addresses constituting file */
24 int i_lastr; /* last logical block read (for read-ahead) */
25} inode[NINODE];
26
27/* flags */
28#define ILOCK 01 /* inode is locked */
29#define IUPD 02 /* inode has been modified */
30#define IACC 04 /* inode access time to be updated */
31#define IMOUNT 010 /* inode is mounted on */
32#define IWANT 020 /* some process waiting on lock */
33#define ITEXT 040 /* inode is pure text prototype */
34
35/* modes */
36#define IALLOC 0100000 /* file is used */
37#define IFMT 060000 /* type of file */
38#define IFDIR 040000 /* directory */
39#define IFCHR 020000 /* character special */
40#define IFBLK 060000 /* block special, 0 is regular */
41#define ILARG 010000 /* large addressing algorithm */
42#define ISUID 04000 /* set user id on execution */
43#define ISGID 02000 /* set group id on execution */
44#define ISVTX 01000 /* save swapped text even after use */
45#define IREAD 0400 /* read, write, execute permissions */
46#define IWRITE 0200
47#define IEXEC 0100