. service tells you which device it couldn't stat
[minix3.git] / servers / vfs / request.h
blobca65ac016bd4659980cc763f7cb8ac9b09419e13
2 /* Low level request messages are built and sent by wrapper functions.
3 * This file contains the request and response structures for accessing
4 * those wrappers functions.
5 */
7 #include <sys/types.h>
10 /* Structure for REQ_GETNODE and REQ_PUTNODE requests */
11 typedef struct node_req {
12 endpoint_t fs_e;
13 ino_t inode_nr;
14 } node_req_t;
17 /* Structure for response that contains inode details */
18 typedef struct node_details {
19 endpoint_t fs_e;
20 ino_t inode_nr;
21 mode_t fmode;
22 off_t fsize;
23 unsigned short inode_index;
24 /* For char/block special files */
25 dev_t dev;
27 /* Fields used by the exec() syscall */
28 uid_t uid;
29 gid_t gid;
30 time_t ctime;
31 } node_details_t;
34 /* Structure for REQ_OPEN request */
35 typedef struct open_req {
36 endpoint_t fs_e;
37 ino_t inode_nr;
38 char *lastc;
39 int oflags;
40 mode_t omode;
41 uid_t uid;
42 gid_t gid;
43 } open_req_t;
46 /* Structure for REQ_READ and REQ_WRITE request */
47 typedef struct readwrite_req {
48 int rw_flag;
49 endpoint_t fs_e;
50 endpoint_t user_e;
51 ino_t inode_nr;
52 unsigned short inode_index;
53 int seg;
54 u64_t pos;
55 unsigned int num_of_bytes;
56 char *user_addr;
57 } readwrite_req_t;
60 /* Structure for response of REQ_READ and REQ_WRITE */
61 typedef struct readwrite_res {
62 u64_t new_pos;
63 unsigned int cum_io;
64 } readwrite_res_t;
67 /* Structure for REQ_PIPE request */
68 typedef struct pipe_req {
69 int fs_e;
70 uid_t uid;
71 gid_t gid;
72 } pipe_req_t;
75 /* Structure for REQ_CLONE_OPCL request */
76 typedef struct clone_opcl_req {
77 int fs_e;
78 dev_t dev;
79 } clone_opcl_req_t;
82 /* Structure for REQ_FTRUNC request */
83 typedef struct ftrunc_req {
84 int fs_e;
85 ino_t inode_nr;
86 off_t start;
87 off_t end;
88 } ftrunc_req_t;
91 /* Structure for REQ_CHOWN request */
92 typedef struct chown_req {
93 int fs_e;
94 ino_t inode_nr;
95 uid_t uid;
96 gid_t gid;
97 uid_t newuid;
98 gid_t newgid;
99 } chown_req_t;
102 /* Structure for REQ_CHMOD request */
103 typedef struct chmod_req {
104 int fs_e;
105 ino_t inode_nr;
106 uid_t uid;
107 gid_t gid;
108 mode_t rmode;
109 } chmod_req_t;
112 /* Structure for REQ_ACCESS request */
113 typedef struct access_req {
114 int fs_e;
115 ino_t inode_nr;
116 uid_t uid;
117 gid_t gid;
118 mode_t amode;
119 } access_req_t;
122 /* Structure for REQ_MKNOD request */
123 typedef struct mknod_req {
124 int fs_e;
125 ino_t inode_nr;
126 uid_t uid;
127 gid_t gid;
128 mode_t rmode;
129 dev_t dev;
130 char *lastc;
131 } mknod_req_t;
134 /* Structure for REQ_MKDIR request */
135 typedef struct mkdir_req {
136 int fs_e;
137 ino_t d_inode_nr;
138 uid_t uid;
139 gid_t gid;
140 mode_t rmode;
141 char *lastc;
142 } mkdir_req_t;
145 /* Structure for REQ_UNLINK request */
146 typedef struct unlink_req {
147 int fs_e;
148 ino_t d_inode_nr;
149 uid_t uid;
150 gid_t gid;
151 char *lastc;
152 } unlink_req_t;
155 /* Structure for REQ_UTIME request */
156 typedef struct utime_req {
157 int fs_e;
158 ino_t inode_nr;
159 uid_t uid;
160 gid_t gid;
161 time_t actime;
162 time_t modtime;
163 } utime_req_t;
166 /* Structure for REQ_LINK request */
167 typedef struct link_req {
168 endpoint_t fs_e;
169 ino_t linked_file;
170 ino_t link_parent;
171 uid_t uid;
172 gid_t gid;
173 char *lastc;
174 } link_req_t;
177 /* Structure for REQ_SLINK request */
178 typedef struct slink_req {
179 endpoint_t fs_e;
180 ino_t parent_dir;
181 uid_t uid;
182 gid_t gid;
183 char *lastc;
184 endpoint_t who_e;
185 char *path_addr;
186 unsigned short path_length;
187 } slink_req_t;
190 /* Structure for REQ_RDLINK request */
191 typedef struct rdlink_req {
192 endpoint_t fs_e;
193 ino_t inode_nr;
194 uid_t uid;
195 gid_t gid;
196 endpoint_t who_e;
197 char *path_buffer;
198 unsigned short max_length;
199 } rdlink_req_t;
202 /* Structure for REQ_RENAME request */
203 typedef struct rename_req {
204 endpoint_t fs_e;
205 ino_t old_dir;
206 ino_t new_dir;
207 uid_t uid;
208 gid_t gid;
209 char *old_name;
210 char *new_name;
211 } rename_req_t;
214 /* Structure for REQ_MOUNTPOINT request */
215 typedef struct mountpoint_req {
216 endpoint_t fs_e;
217 ino_t inode_nr;
218 uid_t uid;
219 gid_t gid;
220 } mountpoint_req_t;
223 /* Structure for REQ_READSUPER request */
224 typedef struct readsuper_req {
225 endpoint_t fs_e;
226 time_t boottime;
227 endpoint_t driver_e;
228 dev_t dev;
229 char *slink_storage;
230 char isroot;
231 char readonly;
232 } readsuper_req_t;
234 /* Structure for response of READSUPER request */
235 typedef struct readsuper_res {
236 endpoint_t fs_e;
237 ino_t inode_nr;
238 mode_t fmode;
239 off_t fsize;
240 int blocksize;
241 off_t maxsize;
242 } readsuper_res_t;
245 /* Structure for REQ_TRUNC request */
246 typedef struct trunc_req {
247 endpoint_t fs_e;
248 ino_t inode_nr;
249 uid_t uid;
250 gid_t gid;
251 off_t length;
252 } trunc_req_t;
255 /* Structure for REQ_LOOKUP request */
256 typedef struct lookup_req {
257 /* Fields filled in by the caller */
258 char *path;
259 char *lastc;
260 int flags;
261 /* Fields filled in by the path name traversal method */
262 endpoint_t fs_e;
263 ino_t start_dir;
264 ino_t root_dir; /* process' root directory */
265 uid_t uid;
266 gid_t gid;
267 unsigned char symloop;
268 } lookup_req_t;
271 /* Structure for a lookup response */
272 typedef struct lookup_res {
273 endpoint_t fs_e;
274 ino_t inode_nr;
275 mode_t fmode;
276 off_t fsize;
277 uid_t uid;
278 gid_t gid;
279 /* For char/block special files */
280 dev_t dev;
282 /* Fields used for handling mount point and symbolic links */
283 int char_processed;
284 unsigned char symloop;
285 } lookup_res_t;
288 /* Structure for REQ_BREAD and REQ_BWRITE request (block spec files) */
289 typedef struct breadwrite_req {
290 int rw_flag;
291 short blocksize;
292 endpoint_t fs_e;
293 endpoint_t user_e;
294 endpoint_t driver_e;
295 dev_t dev;
296 u64_t pos;
297 unsigned int num_of_bytes;
298 char *user_addr;
299 } breadwrite_req_t;
303 /* Structure for REQ_ request */