|
|
1.1 root 1: /* (-lgl
2: * COHERENT Version 4.0
3: * Copyright (c) 1982, 1992 by Mark Williams Company.
4: * All rights reserved. May not be copied without permission.
5: -lgl) */
6: /*
7: * /usr/include/sys/inode.h
8: * Memory resident inodes.
9: */
10:
11: #ifndef _INODE_H
12: #define _INODE_H
13:
14: #include <sys/types.h>
15:
16: /*
17: * Size of pipe buffer.
18: */
19: #define PIPSIZE (ND*BSIZE)
20:
21: /*
22: * File inode.
23: */
24: typedef struct inode {
25: dev_t i_dev; /* Device */
26: ino_t i_ino; /* Inode index */
27: int i_refc; /* Reference count */
28: unsigned i_lrt; /* Last reference time */
29: GATE i_gate; /* Gate */
30: int i_flag; /* Flags */
31: int i_mode; /* Mode and type */
32: int i_nlink; /* Number of links */
33: int i_uid; /* Owner's user id */
34: int i_gid; /* Owner's group id */
35: fsize_t i_size; /* Size of file in bytes */
36: union ia_u {
37: daddr_t i_addr[13]; /* Disk addresses */
38: dev_t i_rdev; /* Real device */
39: struct ip_s { /* Pipes */
40: daddr_t ip_pipe[10];
41: int ip_pnc;
42: int ip_prx;
43: int ip_pwx;
44: } i_p;
45: } i_a; /* Addresses */
46: time_t i_atime; /* Last access time */
47: time_t i_mtime; /* Last modify time */
48: time_t i_ctime; /* Creation time */
49: #ifdef _I386
50: struct rlock *i_rl; /* List of record locks */
51: #endif
52: } INODE;
53:
54: /*
55: * Compatibility.
56: */
57: #define i_pipe i_a.i_p.ip_pipe
58: #define i_pnc i_a.i_p.ip_pnc
59: #define i_prx i_a.i_p.ip_prx
60: #define i_pwx i_a.i_p.ip_pwx
61:
62: /*
63: * Flags.
64: */
65: #define IFACC 0x1 /* File has been accessed */
66: #define IFMOD 0x2 /* File has been modified */
67: #define IFCRT 0x4 /* File has been created */
68: #define IFMNT 0x8 /* Contains mounted file system */
69: #define IFWFR 0x10 /* Sleeping on pipe full */
70: #define IFWFW 0x20 /* Sleeping on pipe empty */
71: #define IFEOF 0x40 /* End of file on pipe */
72: #ifdef _I386
73: #define IFEXCL 0x80 /* Exclusive open */
74: #endif /* _I386 */
75:
76: /*
77: * Permission bits.
78: */
79: #define IPE 0x01 /* Execute */
80: #define IPW 0x02 /* Write */
81: #define IPR 0x04 /* Read */
82:
83: /*
84: * Modifier bits for fdopen().
85: */
86: #define IPNDLY 0x08
87: #define IPAPPEND 0x10
88: #ifdef _I386
89: #define IPSYNC 0x20
90: #define IPEXCL 0x40
91: #define IPNOCTTY 0x80
92: #endif /* _I386 */
93:
94: /*
95: * Bit for dup system call.
96: */
97: #define DUP2 0x40
98:
99: #ifdef KERNEL
100: /*
101: * Macro functions.
102: */
103: #define ilock(ip) lock(ip->i_gate)
104: #define iunlock(ip) unlock(ip->i_gate)
105: #define ilocked(ip) locked(ip->i_gate)
106:
107: /*
108: * Functions to set modify time.
109: */
110: #define iacc(ip) { \
111: ip->i_flag |= IFACC; \
112: ip->i_atime = timer.t_time; \
113: }
114:
115: #define imod(ip) { \
116: ip->i_flag |= IFMOD; \
117: ip->i_mtime = timer.t_time; \
118: }
119:
120: #define icrt(ip) { \
121: ip->i_flag |= IFCRT; \
122: ip->i_ctime = timer.t_time; \
123: }
124:
125: #define iamc(ip) { \
126: ip->i_flag |= IFACC|IFMOD|IFCRT; \
127: ip->i_atime = timer.t_time; \
128: ip->i_mtime = timer.t_time; \
129: ip->i_ctime = timer.t_time; \
130: }
131:
132: /*
133: * Functions.
134: */
135: extern INODE *exlopen(); /* exec.c */
136: extern INODE *ftoim(); /* fs1.c */
137: extern INODE *imake(); /* fs1.c */
138: extern INODE *iattach(); /* fs1.c */
139: extern INODE *ialloc(); /* fs2.c */
140: extern daddr_t balloc(); /* fs2.c */
141: extern INODE *pmake(); /* pipe.c */
142:
143: /*
144: * Global variables.
145: */
146: extern int ronflag; /* Root is read only */
147: extern INODE *inodep; /* Pointer to in core inodes */
148: extern INODE *acctip; /* Accounting file pointer */
149:
150: #endif
151:
152: #endif
153:
154: /* end of sys/inode.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.