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
- in line 33(2),
64(2)
- in /usr/src/cmd/ls/symlnk_ucbls.c line
873(2),
1419-1421(4)
- in /usr/src/cmd/ls/ucbls.c line
842(2),
1388-1390(4)
- in /usr/src/sys/dev/Others/mx1.c line
38(2),
99(2),
130(2),
338(2),
469(2),
475(2),
526(2),
560-562(4),
577-581(4),
587(2)
- in /usr/src/sys/dev/Others/mx2.c line
21(2),
41(2),
59(2),
140(2),
190(2),
217(2),
315(2),
648(2),
734(2),
828-829(6),
850(2),
861(2),
871(2),
886-888(4),
895(2),
915(2)
inode
defined in line
42; used 245 times
- in line 34,
78-81(4),
87-89(4)
- in /usr/src/cmd/mkfs.c line
216(2),
224-226(4),
267(2),
535(2),
590(2),
657-659(4)
- in /usr/src/cmd/pstat.c line
142-143(4),
160(2),
168(2)
- in /usr/src/sys/GENERIC/param.c line
76(2),
105(2),
119(2)
- in /usr/src/sys/conf/param.c line
76(2),
105(2),
119(2)
- in /usr/src/sys/dev/Others/mx1.c line
96(2),
126(2)
- in /usr/src/sys/dev/Others/mx2.c line
141(2)
- in /usr/src/sys/stand/libsa/SYS.c line
95(2),
180(2)
- in /usr/src/sys/sys/acct.c line
22(2),
64(2)
- in /usr/src/sys/sys/alloc.c line
28-34(6),
53(2),
156-159(4),
241(2),
247(2),
431(2)
- in /usr/src/sys/sys/fio.c line
57(2),
144(2),
191(2),
239(2),
247(2),
254-255(4),
266-270(4)
- in /usr/src/sys/sys/iget.c line
38-39(4),
47(2),
59-64(4),
70(2),
92-102(6),
202(2),
232-238(6),
315(2),
384(2),
390(2),
463(2),
500-503(4),
535(2)
- in /usr/src/sys/sys/ioctl.c line
47(2)
- in /usr/src/sys/sys/main.c line
137(2)
- in /usr/src/sys/sys/nami.c line
35(2),
44(2),
310-313(6),
363(2),
410-412(4)
- in /usr/src/sys/sys/pipe.c line
33(2),
86(2),
142(2),
218(2),
236(2)
- in /usr/src/sys/sys/rdwri.c line
24(2),
103(2)
- in /usr/src/sys/sys/sigjcl.c line
531(2)
- in /usr/src/sys/sys/signojcl.c line
241(2)
- in /usr/src/sys/sys/subr.c line
28(2)
- in /usr/src/sys/sys/sys1.c line
43(2),
266(2)
- in /usr/src/sys/sys/sys2.c line
44(2),
116(2),
138(2),
167(2),
280(2),
342(2),
381(2)
- in /usr/src/sys/sys/sys3.c line
49(2),
73(2),
93(2),
180(2),
259(2),
308(2),
332(2),
366(2)
- in /usr/src/sys/sys/sys4.c line
148(2),
228-230(4),
259(2),
284(2),
569(2)
- in /usr/src/sys/sys/syslocal.c line
88(2),
149(2),
160(2),
171-172(4),
188(2),
403(2),
652(2)
- in /usr/src/sys/sys/text.c line
107(2),
146(2),
342(2),
360(2)
Defined macros
IACC
defined in line
96; used 12 times
ICHG
defined in line
100; used 23 times
- in /usr/src/sys/dev/Others/mx1.c line
197
- in /usr/src/sys/dev/Others/mx2.c line
193
- in /usr/src/sys/sys/iget.c line
257,
327,
361-363(2),
410-412(2),
446,
510
- in /usr/src/sys/sys/nami.c line
160
- in /usr/src/sys/sys/pipe.c line
77
- in /usr/src/sys/sys/rdwri.c line
132,
216
- in /usr/src/sys/sys/subr.c line
66,
112
- in /usr/src/sys/sys/sys2.c line
302,
331,
366
- in /usr/src/sys/sys/sys4.c line
209,
276,
300,
581
IFBLK
defined in line
111; used 13 times
IFCHR
defined in line
109; used 16 times
IFDIR
defined in line
108; used 37 times
- in /usr/src/cmd/512dumpdir.c line
160
- in /usr/src/cmd/512restor.c line
478,
854
- in /usr/src/cmd/dcheck.c line
142
- in /usr/src/cmd/dump.c line
273-278(2),
317
- in /usr/src/cmd/dumpdir.c line
122
- in /usr/src/cmd/fsck.c line
43,
596
- in /usr/src/cmd/icheck.c line
271
- in /usr/src/cmd/mkfs.c line
237,
665
- in /usr/src/cmd/ncheck.c line
150,
173,
215
- in /usr/src/cmd/quot.c line
132
- in /usr/src/cmd/restor.c line
455,
833
- in /usr/src/sys/stand/libsa/SYS.c line
190
- in /usr/src/sys/sys/iget.c line
395-397(2)
- in /usr/src/sys/sys/ioctl.c line
86
- in /usr/src/sys/sys/nami.c line
124
- in /usr/src/sys/sys/rdwri.c line
182,
211-213(2)
- in /usr/src/sys/sys/subr.c line
55,
141
- in /usr/src/sys/sys/sys2.c line
178,
295-297(2)
- in /usr/src/sys/sys/sys4.c line
172-174(2),
239
- in /usr/src/ucb/dump/src/dumptraverse.c line
98,
144
IFMT
defined in line
107; used 71 times
- in /usr/src/cmd/512dumpdir.c line
159
- in /usr/src/cmd/512restor.c line
477,
853
- in /usr/src/cmd/dcheck.c line
142,
184
- in /usr/src/cmd/dump.c line
269,
316
- in /usr/src/cmd/dumpdir.c line
121
- in /usr/src/cmd/fsck.c line
42-50(8),
595,
1391
- in /usr/src/cmd/icheck.c line
250
- in /usr/src/cmd/mkfs.c line
273,
619
- in /usr/src/cmd/ncheck.c line
150-153(3),
173,
215
- in /usr/src/cmd/pstat.c line
191(2)
- in /usr/src/cmd/quot.c line
129-132(3)
- in /usr/src/cmd/restor.c line
454,
812,
832,
1150
- in /usr/src/sys/dev/Others/mx1.c line
202,
259,
385
- in /usr/src/sys/dev/Others/mx2.c line
150
- in /usr/src/sys/stand/libsa/SYS.c line
190
- in /usr/src/sys/sys/acct.c line
48
- in /usr/src/sys/sys/fio.c line
100,
151
- in /usr/src/sys/sys/iget.c line
347-348(2),
393,
511
- in /usr/src/sys/sys/ioctl.c line
78
- in /usr/src/sys/sys/nami.c line
124,
310
- in /usr/src/sys/sys/rdwri.c line
41,
125,
182
- in /usr/src/sys/sys/sigjcl.c line
561
- in /usr/src/sys/sys/signojcl.c line
271
- in /usr/src/sys/sys/subr.c line
55,
141
- in /usr/src/sys/sys/sys1.c line
70
- in /usr/src/sys/sys/sys2.c line
178,
295-297(2)
- in /usr/src/sys/sys/sys3.c line
317,
342
- in /usr/src/sys/sys/sys4.c line
172-174(2),
239
- in /usr/src/sys/sys/syslocal.c line
105,
414,
670
- in /usr/src/ucb/dump/src/dumptraverse.c line
94,
143
IFREG
defined in line
113; used 23 times
ILOCK
defined in line
94; used 16 times
ITEXT
defined in line
99; used 13 times
IUPD
defined in line
95; used 22 times
IWANT
defined in line
98; used 5 times
NADDR
defined in line
21; used 89 times
- in line 55
- in /usr/src/cmd/512restor.c line
113,
427-432(2),
849,
856-857(2),
866-874(3),
963,
974,
987,
1002-1003(2)
- in /usr/src/cmd/dcheck.c line
23,
144,
218-225(3)
- in /usr/src/cmd/dump.c line
225-233(6),
637-638(2)
- in /usr/src/cmd/fsck.c line
828-834(3)
- in /usr/src/cmd/icheck.c line
26,
279-283(3),
295,
307
- in /usr/src/cmd/mkfs.c line
26,
265,
561,
639,
673,
682-686(2)
- in /usr/src/cmd/ncheck.c line
28,
175,
217,
323-330(3)
- in /usr/src/cmd/restor.c line
83,
404-409(2),
828,
835-836(2),
845-853(3),
944,
955,
968,
983-984(2)
- in /usr/src/sys/stand/libsa/SYS.c line
45,
108,
122,
138
- in /usr/src/sys/sys/alloc.c line
268
- in /usr/src/sys/sys/iget.c line
216,
344,
408,
421,
432-440(3)
- in /usr/src/sys/sys/subr.c line
47,
68,
81,
97,
111
- in /usr/src/ucb/dump/src/dumpitime.c line
220,
226
- in /usr/src/ucb/dump/src/dumptraverse.c line
50-58(6)
i_addr
defined in line
58; used 23 times
- in /usr/src/cmd/mkfs.c line
266,
304,
562,
626-639(4),
674
- in /usr/src/sys/stand/libsa/SYS.c line
45,
110,
138
- in /usr/src/sys/sys/alloc.c line
269
- in /usr/src/sys/sys/iget.c line
214,
343,
353,
409,
422-425(2)
- in /usr/src/sys/sys/subr.c line
49,
65-69(2),
97,
111
i_rdev
defined in line
62; used 19 times
Usage of this include