removal of unused vm<->vfs code.
[minix.git] / servers / vfs / proto.h
blob2145379b06f4e2e4597e42bf47575be1d007f923
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 /* mount.c */
91 _PROTOTYPE( int do_fslogin, (void) );
92 _PROTOTYPE( int do_mount, (void) );
93 _PROTOTYPE( int do_umount, (void) );
94 _PROTOTYPE( int unmount, (Dev_t dev, char *label) );
96 /* open.c */
97 _PROTOTYPE( int do_close, (void) );
98 _PROTOTYPE( int close_fd, (struct fproc *rfp, int fd_nr) );
99 _PROTOTYPE( void close_filp, (struct filp *fp) );
100 _PROTOTYPE( void close_reply, (void) );
101 _PROTOTYPE( int do_creat, (void) );
102 _PROTOTYPE( int do_lseek, (void) );
103 _PROTOTYPE( int do_llseek, (void) );
104 _PROTOTYPE( int do_mknod, (void) );
105 _PROTOTYPE( int do_mkdir, (void) );
106 _PROTOTYPE( int do_open, (void) );
107 _PROTOTYPE( int do_slink, (void) );
108 _PROTOTYPE( int do_vm_open, (void) );
109 _PROTOTYPE( int do_vm_close, (void) );
111 /* path.c */
112 _PROTOTYPE( struct vnode *advance, (struct vnode *dirp, int flags) );
113 _PROTOTYPE( struct vnode *eat_path, (int flags) );
114 _PROTOTYPE( struct vnode *last_dir, (void) );
116 /* pipe.c */
117 _PROTOTYPE( int do_pipe, (void) );
118 _PROTOTYPE( int map_vnode, (struct vnode *vp) );
119 _PROTOTYPE( void unpause, (int proc_nr_e) );
120 _PROTOTYPE( int pipe_check, (struct vnode *vp, int rw_flag,
121 int oflags, int bytes, u64_t position, int notouch) );
122 _PROTOTYPE( void release, (struct vnode *vp, int call_nr, int count) );
123 _PROTOTYPE( void revive, (int proc_nr, int bytes) );
124 _PROTOTYPE( void suspend, (int task) );
125 _PROTOTYPE( void pipe_suspend, (int rw_flag, int fd_nr, char *buf,
126 size_t size) );
127 _PROTOTYPE( int select_request_pipe, (struct filp *f, int *ops, int bl) );
128 _PROTOTYPE( int select_match_pipe, (struct filp *f) );
129 _PROTOTYPE( void unsuspend_by_endpt, (endpoint_t) );
130 _PROTOTYPE( void select_reply1, (void) );
131 _PROTOTYPE( void select_reply2, (void) );
132 _PROTOTYPE( void wait_for, (endpoint_t) );
133 #if DO_SANITYCHECKS
134 _PROTOTYPE( int check_pipe, (void) );
135 #endif
137 /* protect.c */
138 _PROTOTYPE( int do_access, (void) );
139 _PROTOTYPE( int do_chmod, (void) );
140 _PROTOTYPE( int do_chown, (void) );
141 _PROTOTYPE( int do_umask, (void) );
142 _PROTOTYPE( int forbidden, (struct vnode *vp, mode_t access_desired) );
143 _PROTOTYPE( int read_only, (struct vnode *vp) );
145 /* read.c */
146 _PROTOTYPE( int do_read, (void) );
147 _PROTOTYPE( int do_getdents, (void) );
148 _PROTOTYPE( int read_write, (int rw_flag) );
149 _PROTOTYPE( int rw_pipe, (int rw_flag, endpoint_t usr,
150 int fd_nr, struct filp *f, char *buf, size_t req_size) );
152 /* request.c */
153 _PROTOTYPE( int req_breadwrite, (endpoint_t fs_e, endpoint_t user_e,
154 Dev_t dev, u64_t pos, unsigned int num_of_bytes,
155 char *user_addr, int rw_flag,
156 u64_t *new_posp, unsigned int *cum_iop) );
157 _PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, _mnx_Mode_t rmode,
158 mode_t *new_modep) );
159 _PROTOTYPE( int req_chown, (endpoint_t fs_e, ino_t inode_nr,
160 _mnx_Uid_t newuid, _mnx_Gid_t newgid, mode_t *new_modep) );
161 _PROTOTYPE( int req_create, (int fs_e, ino_t inode_nr, int omode,
162 int uid, int gid, char *path, node_details_t *res) );
163 _PROTOTYPE( int req_flush, (endpoint_t fs_e, Dev_t dev) );
164 _PROTOTYPE( int req_fstatfs, (int fs_e, int who_e, char *buf) );
165 _PROTOTYPE( int req_ftrunc, (endpoint_t fs_e, ino_t inode_nr,
166 off_t start, off_t end) );
167 _PROTOTYPE( int req_getdents, (endpoint_t fs_e, ino_t inode_nr, u64_t pos,
168 char *buf, size_t size, u64_t *new_pos) );
169 _PROTOTYPE( int req_inhibread, (endpoint_t fs_e, ino_t inode_nr) );
170 _PROTOTYPE( int req_link, (endpoint_t fs_e, ino_t link_parent,
171 char *lastc, ino_t linked_file) );
172 _PROTOTYPE( int req_lookup, (endpoint_t fs_e, ino_t dir_ino, ino_t root_ino,
173 _mnx_Uid_t uid, _mnx_Gid_t gid, int flags,
174 lookup_res_t *res) );
175 _PROTOTYPE( int req_mkdir, (endpoint_t fs_e, ino_t inode_nr,
176 char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid, _mnx_Mode_t dmode) );
177 _PROTOTYPE( int req_mknod, (endpoint_t fs_e, ino_t inode_nr,
178 char *lastc, _mnx_Uid_t uid, _mnx_Gid_t gid,
179 _mnx_Mode_t dmode, Dev_t dev) );
180 _PROTOTYPE( int req_mountpoint, (endpoint_t fs_e, ino_t inode_nr) );
181 _PROTOTYPE( int req_newnode, (endpoint_t fs_e, _mnx_Uid_t uid,
182 _mnx_Gid_t gid, _mnx_Mode_t dmode,
183 Dev_t dev, struct node_details *res) );
184 _PROTOTYPE( int req_putnode, (int fs_e, ino_t inode_nr, int count) );
185 _PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr,
186 endpoint_t who_e, char *buf, size_t len) );
187 _PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name,
188 Dev_t dev, int readonly, int isroot,
189 struct node_details *res_nodep) );
190 _PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr,
191 u64_t pos, int rw_flag,
192 endpoint_t user_e, char *user_addr,
193 unsigned int num_of_bytes, u64_t *new_posp,
194 unsigned int *cum_iop) );
195 _PROTOTYPE( int req_rename, (endpoint_t fs_e, ino_t old_dir,
196 char *old_name, ino_t new_dir, char *new_name) );
197 _PROTOTYPE( int req_rmdir, (endpoint_t fs_e, ino_t inode_nr,
198 char *lastc) );
199 _PROTOTYPE(int req_slink, (endpoint_t fs_e, ino_t inode_nr, char *lastc,
200 endpoint_t who_e, char *path_addr,
201 int path_length, _mnx_Uid_t uid, _mnx_Gid_t gid) );
202 _PROTOTYPE( int req_stat, (int fs_e, ino_t inode_nr, int who_e,
203 char *buf, int pos) );
204 _PROTOTYPE( int req_sync, (endpoint_t fs_e) );
205 _PROTOTYPE( int req_unlink, (endpoint_t fs_e, ino_t inode_nr,
206 char *lastc) );
207 _PROTOTYPE( int req_unmount, (endpoint_t fs_e) );
208 _PROTOTYPE( int req_utime, (endpoint_t fs_e, ino_t inode_nr,
209 time_t actime, time_t modtime) );
210 _PROTOTYPE( int req_newdriver, (endpoint_t fs_e, Dev_t dev,
211 endpoint_t driver_e) );
213 /* stadir.c */
214 _PROTOTYPE( int do_chdir, (void) );
215 _PROTOTYPE( int do_fchdir, (void) );
216 _PROTOTYPE( int do_chroot, (void) );
217 _PROTOTYPE( int do_fstat, (void) );
218 _PROTOTYPE( int do_stat, (void) );
219 _PROTOTYPE( int do_fstatfs, (void) );
220 _PROTOTYPE( int do_rdlink, (void) );
221 _PROTOTYPE( int do_lstat, (void) );
223 /* time.c */
224 _PROTOTYPE( int do_utime, (void) );
226 /* utility.c */
227 _PROTOTYPE( time_t clock_time, (void) );
228 _PROTOTYPE( unsigned conv2, (int norm, int w) );
229 _PROTOTYPE( long conv4, (int norm, long x) );
230 _PROTOTYPE( int fetch_name, (char *path, int len, int flag) );
231 _PROTOTYPE( int no_sys, (void) );
232 _PROTOTYPE( int isokendpt_f, (char *f, int l, int e, int *p, int ft));
233 _PROTOTYPE( void panic, (char *who, char *mess, int num) );
235 #define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
236 #define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
238 /* vmnt.c */
239 _PROTOTYPE( struct vmnt *get_free_vmnt, (short *index) );
240 _PROTOTYPE( struct vmnt *find_vmnt, (int fs_e) );
242 /* vnode.c */
243 _PROTOTYPE( struct vnode *get_free_vnode, (void) );
244 _PROTOTYPE( struct vnode *find_vnode, (int fs_e, int numb) );
245 _PROTOTYPE( void dup_vnode, (struct vnode *vp) );
246 _PROTOTYPE( void put_vnode, (struct vnode *vp) );
247 _PROTOTYPE( void vnode_clean_refs, (struct vnode *vp) );
248 #if DO_SANITYCHECKS
249 _PROTOTYPE( int check_vrefs, (void) );
250 #endif
252 /* write.c */
253 _PROTOTYPE( int do_write, (void) );
255 /* select.c */
256 _PROTOTYPE( int do_select, (void) );
257 _PROTOTYPE( int select_callback, (struct filp *, int ops) );
258 _PROTOTYPE( void select_forget, (int fproc) );
259 _PROTOTYPE( void select_timeout_check, (timer_t *) );
260 _PROTOTYPE( void init_select, (void) );
261 _PROTOTYPE( void select_unsuspend_by_endpt, (endpoint_t proc) );
262 _PROTOTYPE( int select_notified, (int major, int minor, int ops) );
264 /* timers.c */
265 _PROTOTYPE( void fs_set_timer, (timer_t *tp, int delta,
266 tmr_func_t watchdog, int arg) );
267 _PROTOTYPE( void fs_expire_timers, (clock_t now) );
268 _PROTOTYPE( void fs_cancel_timer, (timer_t *tp) );
269 _PROTOTYPE( void fs_init_timer, (timer_t *tp) );