Fixed extern declaration from pointer to array
[minix.git] / servers / vfs / proto.h
blob1d8968e685a9e2186a83ecb32d1b33b336cd2a5c
1 /* Function prototypes. */
3 #include "timers.h"
4 #include "request.h"
6 /* Structs used in prototypes must be declared as such first. */
7 struct filp;
8 struct fproc;
9 struct vmnt;
10 struct vnode;
12 /* device.c */
13 _PROTOTYPE( int dev_open, (Dev_t dev, int proc, int flags) );
14 _PROTOTYPE( int dev_reopen, (Dev_t dev, int filp_no, int flags) );
15 _PROTOTYPE( int dev_close, (Dev_t dev, int filp_no) );
16 _PROTOTYPE( int dev_io, (int op, Dev_t dev, int proc, void *buf,
17 u64_t pos, int bytes, int flags, int suspend_reopen) );
18 _PROTOTYPE( int gen_opcl, (int op, Dev_t dev, int proc, int flags) );
19 _PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) );
20 _PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) );
21 _PROTOTYPE( int no_dev, (int op, Dev_t dev, int proc, int flags) );
22 _PROTOTYPE( int no_dev_io, (int, message *) );
23 _PROTOTYPE( int tty_opcl, (int op, Dev_t dev, int proc, int flags) );
24 _PROTOTYPE( int ctty_opcl, (int op, Dev_t dev, int proc, int flags) );
25 _PROTOTYPE( int clone_opcl, (int op, Dev_t dev, int proc, int flags) );
26 _PROTOTYPE( int ctty_io, (int task_nr, message *mess_ptr) );
27 _PROTOTYPE( int do_ioctl, (void) );
28 _PROTOTYPE( void pm_setsid, (int proc_e) );
29 _PROTOTYPE( void dev_status, (message *) );
30 _PROTOTYPE( void dev_up, (int major) );
31 _PROTOTYPE( endpoint_t suspended_ep, (endpoint_t driver,
32 cp_grant_id_t g) );
33 _PROTOTYPE( void reopen_reply, (void) );
35 /* dmap.c */
36 _PROTOTYPE( int do_mapdriver, (void) );
37 _PROTOTYPE( void build_dmap, (void) );
38 _PROTOTYPE( int map_driver, (char *label, int major, int proc_nr,
39 int dev_style, int force) );
40 _PROTOTYPE( int dmap_driver_match, (endpoint_t proc, int major) );
41 _PROTOTYPE( void dmap_unmap_by_endpt, (int proc_nr) );
42 _PROTOTYPE( void dmap_endpt_up, (int proc_nr) );
44 /* exec.c */
45 _PROTOTYPE( int pm_exec, (int proc_e, char *path, vir_bytes path_len,
46 char *frame, vir_bytes frame_len) );
48 /* filedes.c */
49 _PROTOTYPE( struct filp *find_filp, (struct vnode *vp, mode_t bits) );
50 _PROTOTYPE( int get_fd, (int start, mode_t bits, int *k,
51 struct filp **fpt) );
52 _PROTOTYPE( struct filp *get_filp, (int fild) );
53 _PROTOTYPE( struct filp *get_filp2, (struct fproc *rfp, int fild) );
54 _PROTOTYPE( int invalidate, (struct filp *) );
56 /* fscall.c */
57 _PROTOTYPE( void nested_fs_call, (message *m) );
59 /* link.c */
60 _PROTOTYPE( int do_link, (void) );
61 _PROTOTYPE( int do_unlink, (void) );
62 _PROTOTYPE( int do_rename, (void) );
63 _PROTOTYPE( int do_truncate, (void) );
64 _PROTOTYPE( int do_ftruncate, (void) );
65 _PROTOTYPE( int truncate_vnode, (struct vnode *vp, off_t newsize) );
67 /* lock.c */
68 _PROTOTYPE( int lock_op, (struct filp *f, int req) );
69 _PROTOTYPE( void lock_revive, (void) );
71 /* main.c */
72 _PROTOTYPE( int main, (void) );
73 _PROTOTYPE( void reply, (int whom, int result) );
75 /* misc.c */
76 _PROTOTYPE( int do_dup, (void) );
77 _PROTOTYPE( void pm_exit, (int proc) );
78 _PROTOTYPE( int do_fcntl, (void) );
79 _PROTOTYPE( void pm_fork, (int pproc, int cproc, int cpid) );
80 _PROTOTYPE( void pm_setgid, (int proc_e, int egid, int rgid) );
81 _PROTOTYPE( void pm_setuid, (int proc_e, int euid, int ruid) );
82 _PROTOTYPE( void pm_setgroups, (int proc_e, int ngroups, gid_t *addr) );
83 _PROTOTYPE( int do_sync, (void) );
84 _PROTOTYPE( int do_fsync, (void) );
85 _PROTOTYPE( void pm_reboot, (void) );
86 _PROTOTYPE( int do_svrctl, (void) );
87 _PROTOTYPE( int do_getsysinfo, (void) );
88 _PROTOTYPE( int pm_dumpcore, (int proc_e, struct mem_map *seg_ptr) );
90 /* mmap.c */
91 _PROTOTYPE( int do_vm_mmap, (void) );
93 /* mount.c */
94 _PROTOTYPE( int do_fslogin, (void) );
95 _PROTOTYPE( int do_mount, (void) );
96 _PROTOTYPE( int do_umount, (void) );
97 _PROTOTYPE( int unmount, (Dev_t dev, char *label) );
99 /* open.c */
100 _PROTOTYPE( int do_close, (void) );
101 _PROTOTYPE( int close_fd, (struct fproc *rfp, int fd_nr) );
102 _PROTOTYPE( void close_filp, (struct filp *fp) );
103 _PROTOTYPE( void close_reply, (void) );
104 _PROTOTYPE( int do_creat, (void) );
105 _PROTOTYPE( int do_lseek, (void) );
106 _PROTOTYPE( int do_llseek, (void) );
107 _PROTOTYPE( int do_mknod, (void) );
108 _PROTOTYPE( int do_mkdir, (void) );
109 _PROTOTYPE( int do_open, (void) );
110 _PROTOTYPE( int do_slink, (void) );
111 _PROTOTYPE( int do_vm_open, (void) );
112 _PROTOTYPE( int do_vm_close, (void) );
114 /* path.c */
115 _PROTOTYPE( struct vnode *advance, (struct vnode *dirp, int flags) );
116 _PROTOTYPE( struct vnode *eat_path, (int flags) );
117 _PROTOTYPE( struct vnode *last_dir, (void) );
119 /* pipe.c */
120 _PROTOTYPE( int do_pipe, (void) );
121 _PROTOTYPE( int map_vnode, (struct vnode *vp) );
122 _PROTOTYPE( void unpause, (int proc_nr_e) );
123 _PROTOTYPE( int pipe_check, (struct vnode *vp, int rw_flag,
124 int oflags, int bytes, u64_t position, int notouch) );
125 _PROTOTYPE( void release, (struct vnode *vp, int call_nr, int count) );
126 _PROTOTYPE( void revive, (int proc_nr, int bytes) );
127 _PROTOTYPE( void suspend, (int task) );
128 _PROTOTYPE( void pipe_suspend, (int rw_flag, int fd_nr, char *buf,
129 size_t size) );
130 _PROTOTYPE( int select_request_pipe, (struct filp *f, int *ops, int bl) );
131 _PROTOTYPE( int select_match_pipe, (struct filp *f) );
132 _PROTOTYPE( void unsuspend_by_endpt, (endpoint_t) );
133 _PROTOTYPE( void select_reply1, (void) );
134 _PROTOTYPE( void select_reply2, (void) );
135 _PROTOTYPE( void wait_for, (endpoint_t) );
136 #if DO_SANITYCHECKS
137 _PROTOTYPE( int check_pipe, (void) );
138 #endif
140 /* protect.c */
141 _PROTOTYPE( int do_access, (void) );
142 _PROTOTYPE( int do_chmod, (void) );
143 _PROTOTYPE( int do_chown, (void) );
144 _PROTOTYPE( int do_umask, (void) );
145 _PROTOTYPE( int forbidden, (struct vnode *vp, mode_t access_desired) );
146 _PROTOTYPE( int read_only, (struct vnode *vp) );
148 /* read.c */
149 _PROTOTYPE( int do_read, (void) );
150 _PROTOTYPE( int do_getdents, (void) );
151 _PROTOTYPE( int read_write, (int rw_flag) );
152 _PROTOTYPE( int rw_pipe, (int rw_flag, endpoint_t usr,
153 int fd_nr, struct filp *f, char *buf, size_t req_size) );
155 /* request.c */
156 _PROTOTYPE( int req_breadwrite, (endpoint_t fs_e, endpoint_t user_e,
157 Dev_t dev, u64_t pos, unsigned int num_of_bytes,
158 char *user_addr, int rw_flag,
159 u64_t *new_posp, unsigned int *cum_iop) );
160 _PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, _mnx_Mode_t rmode,
161 mode_t *new_modep) );
162 _PROTOTYPE( int req_chown, (endpoint_t fs_e, ino_t inode_nr,
163 _mnx_Uid_t newuid, _mnx_Gid_t newgid, mode_t *new_modep) );
164 _PROTOTYPE( int req_create, (int fs_e, ino_t inode_nr, int omode,
165 int uid, int gid, char *path, node_details_t *res) );
166 _PROTOTYPE( int req_flush, (endpoint_t fs_e, Dev_t dev) );
167 _PROTOTYPE( int req_fstatfs, (int fs_e, int who_e, char *buf) );
168 _PROTOTYPE( int req_ftrunc, (endpoint_t fs_e, ino_t inode_nr,
169 off_t start, off_t end) );
170 _PROTOTYPE( int req_getdents, (endpoint_t fs_e, ino_t inode_nr, u64_t pos,
171 char *buf, size_t size, u64_t *new_pos) );
172 _PROTOTYPE( int req_inhibread, (endpoint_t fs_e, ino_t inode_nr) );
173 _PROTOTYPE( int req_link, (endpoint_t fs_e, ino_t link_parent,
174 char *lastc, ino_t linked_file) );
175 _PROTOTYPE( int req_lookup, (endpoint_t fs_e, ino_t dir_ino, ino_t root_ino,
176 _mnx_Uid_t uid, _mnx_Gid_t gid, int flags,
177 lookup_res_t *res) );
178 _PROTOTYPE( int req_mkdir, (endpoint_t fs_e, ino_t inode_nr,
179 char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid, _mnx_Mode_t dmode) );
180 _PROTOTYPE( int req_mknod, (endpoint_t fs_e, ino_t inode_nr,
181 char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid,
182 _mnx_Mode_t dmode, Dev_t dev) );
183 _PROTOTYPE( int req_mountpoint, (endpoint_t fs_e, ino_t inode_nr) );
184 _PROTOTYPE( int req_newnode, (endpoint_t fs_e, _mnx_Uid_t uid,
185 _mnx_Gid_t gid, _mnx_Mode_t dmode,
186 Dev_t dev, struct node_details *res) );
187 _PROTOTYPE( int req_putnode, (int fs_e, ino_t inode_nr, int count) );
188 _PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr,
189 endpoint_t who_e, char *buf, size_t len) );
190 _PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name,
191 Dev_t dev, int readonly, int isroot,
192 struct node_details *res_nodep) );
193 _PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr,
194 u64_t pos, int rw_flag,
195 endpoint_t user_e, char *user_addr,
196 unsigned int num_of_bytes, u64_t *new_posp,
197 unsigned int *cum_iop) );
198 _PROTOTYPE( int req_rename, (endpoint_t fs_e, ino_t old_dir,
199 char *old_name, ino_t new_dir, char *new_name) );
200 _PROTOTYPE( int req_rmdir, (endpoint_t fs_e, ino_t inode_nr,
201 char *lastc) );
202 _PROTOTYPE(int req_slink, (endpoint_t fs_e, ino_t inode_nr, char *lastc,
203 endpoint_t who_e, char *path_addr,
204 int path_length, _mnx_Uid_t uid, _mnx_Gid_t gid) );
205 _PROTOTYPE( int req_stat, (int fs_e, ino_t inode_nr, int who_e,
206 char *buf, int pos) );
207 _PROTOTYPE( int req_sync, (endpoint_t fs_e) );
208 _PROTOTYPE( int req_unlink, (endpoint_t fs_e, ino_t inode_nr,
209 char *lastc) );
210 _PROTOTYPE( int req_unmount, (endpoint_t fs_e) );
211 _PROTOTYPE( int req_utime, (endpoint_t fs_e, ino_t inode_nr,
212 time_t actime, time_t modtime) );
213 _PROTOTYPE( int req_newdriver, (endpoint_t fs_e, Dev_t dev,
214 endpoint_t driver_e) );
216 /* stadir.c */
217 _PROTOTYPE( int do_chdir, (void) );
218 _PROTOTYPE( int do_fchdir, (void) );
219 _PROTOTYPE( int do_chroot, (void) );
220 _PROTOTYPE( int do_fstat, (void) );
221 _PROTOTYPE( int do_stat, (void) );
222 _PROTOTYPE( int do_fstatfs, (void) );
223 _PROTOTYPE( int do_rdlink, (void) );
224 _PROTOTYPE( int do_lstat, (void) );
226 /* time.c */
227 _PROTOTYPE( int do_utime, (void) );
229 /* utility.c */
230 _PROTOTYPE( time_t clock_time, (void) );
231 _PROTOTYPE( unsigned conv2, (int norm, int w) );
232 _PROTOTYPE( long conv4, (int norm, long x) );
233 _PROTOTYPE( int fetch_name, (char *path, int len, int flag) );
234 _PROTOTYPE( int no_sys, (void) );
235 _PROTOTYPE( int isokendpt_f, (char *f, int l, int e, int *p, int ft));
236 _PROTOTYPE( void panic, (char *who, char *mess, int num) );
238 #define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
239 #define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
241 /* vmnt.c */
242 _PROTOTYPE( struct vmnt *get_free_vmnt, (short *index) );
243 _PROTOTYPE( struct vmnt *find_vmnt, (int fs_e) );
245 /* vnode.c */
246 _PROTOTYPE( struct vnode *get_free_vnode, (void) );
247 _PROTOTYPE( struct vnode *find_vnode, (int fs_e, int numb) );
248 _PROTOTYPE( void dup_vnode, (struct vnode *vp) );
249 _PROTOTYPE( void put_vnode, (struct vnode *vp) );
250 _PROTOTYPE( void vnode_clean_refs, (struct vnode *vp) );
251 #if DO_SANITYCHECKS
252 _PROTOTYPE( int check_vrefs, (void) );
253 #endif
255 /* write.c */
256 _PROTOTYPE( int do_write, (void) );
258 /* select.c */
259 _PROTOTYPE( int do_select, (void) );
260 _PROTOTYPE( int select_callback, (struct filp *, int ops) );
261 _PROTOTYPE( void select_forget, (int fproc) );
262 _PROTOTYPE( void select_timeout_check, (timer_t *) );
263 _PROTOTYPE( void init_select, (void) );
264 _PROTOTYPE( void select_unsuspend_by_endpt, (endpoint_t proc) );
265 _PROTOTYPE( int select_notified, (int major, int minor, int ops) );
267 /* timers.c */
268 _PROTOTYPE( void fs_set_timer, (timer_t *tp, int delta,
269 tmr_func_t watchdog, int arg) );
270 _PROTOTYPE( void fs_expire_timers, (clock_t now) );
271 _PROTOTYPE( void fs_cancel_timer, (timer_t *tp) );
272 _PROTOTYPE( void fs_init_timer, (timer_t *tp) );