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