xref: /minix3/minix/servers/vfs/proto.h (revision 7eb698ea4ab08ffe5f6cf9338e85eaee0f4de4c1)
1433d6423SLionel Sambuc #ifndef __VFS_PROTO_H__
2433d6423SLionel Sambuc #define __VFS_PROTO_H__
3433d6423SLionel Sambuc 
4433d6423SLionel Sambuc /* Function prototypes. */
5433d6423SLionel Sambuc 
6433d6423SLionel Sambuc #include <minix/rs.h>
7433d6423SLionel Sambuc #include <minix/timers.h>
8433d6423SLionel Sambuc 
9433d6423SLionel Sambuc #include "request.h"
10433d6423SLionel Sambuc #include "threads.h"
11433d6423SLionel Sambuc #include "tll.h"
12433d6423SLionel Sambuc 
13433d6423SLionel Sambuc /* Structs used in prototypes must be declared as such first. */
14433d6423SLionel Sambuc struct filp;
15433d6423SLionel Sambuc struct fproc;
16433d6423SLionel Sambuc struct timespec;
17433d6423SLionel Sambuc struct vmnt;
18433d6423SLionel Sambuc struct vnode;
19433d6423SLionel Sambuc struct lookup;
20433d6423SLionel Sambuc struct worker_thread;
21433d6423SLionel Sambuc struct job;
22433d6423SLionel Sambuc 
23433d6423SLionel Sambuc /* comm.c */
24433d6423SLionel Sambuc int drv_sendrec(endpoint_t drv_e, message *reqm);
25433d6423SLionel Sambuc void fs_cancel(struct vmnt *vmp);
26433d6423SLionel Sambuc int fs_sendrec(endpoint_t fs_e, message *reqm);
27433d6423SLionel Sambuc int vm_sendrec(message *reqm);
28433d6423SLionel Sambuc void fs_sendmore(struct vmnt *vmp);
29433d6423SLionel Sambuc void send_work(void);
30433d6423SLionel Sambuc int vm_vfs_procctl_handlemem(endpoint_t ep, vir_bytes mem, vir_bytes len, int flags);
31433d6423SLionel Sambuc 
32433d6423SLionel Sambuc /* device.c */
33433d6423SLionel Sambuc int cdev_open(dev_t dev, int flags);
34433d6423SLionel Sambuc int cdev_close(dev_t dev);
35433d6423SLionel Sambuc int cdev_io(int op, dev_t dev, endpoint_t proc_e, vir_bytes buf, off_t pos,
36433d6423SLionel Sambuc 	unsigned long bytes, int flags);
3727d0ecdbSDavid van Moolenbroek dev_t cdev_map(dev_t dev, struct fproc *rfp);
38433d6423SLionel Sambuc int cdev_select(dev_t dev, int ops);
39433d6423SLionel Sambuc int cdev_cancel(dev_t dev);
40433d6423SLionel Sambuc void cdev_reply(void);
41433d6423SLionel Sambuc int bdev_open(dev_t dev, int access);
42433d6423SLionel Sambuc int bdev_close(dev_t dev);
43433d6423SLionel Sambuc void bdev_reply(void);
443b468884SDavid van Moolenbroek void bdev_up(devmajor_t major);
45433d6423SLionel Sambuc int do_ioctl(void);
46433d6423SLionel Sambuc 
47433d6423SLionel Sambuc /* dmap.c */
48433d6423SLionel Sambuc void lock_dmap(struct dmap *dp);
49433d6423SLionel Sambuc void unlock_dmap(struct dmap *dp);
50433d6423SLionel Sambuc int do_mapdriver(void);
51433d6423SLionel Sambuc void init_dmap(void);
523b468884SDavid van Moolenbroek int dmap_driver_match(endpoint_t proc, devmajor_t major);
53433d6423SLionel Sambuc void dmap_endpt_up(endpoint_t proc_nr, int is_blk);
54433d6423SLionel Sambuc struct dmap *get_dmap(endpoint_t proc_e);
553b468884SDavid van Moolenbroek struct dmap *get_dmap_by_major(devmajor_t major);
56433d6423SLionel Sambuc void dmap_unmap_by_endpt(endpoint_t proc_nr);
57433d6423SLionel Sambuc int map_service(struct rprocpub *rpub);
58433d6423SLionel Sambuc 
59433d6423SLionel Sambuc /* elf_core_dump.c */
60433d6423SLionel Sambuc void write_elf_core_file(struct filp *f, int csig, char *exe_name);
61433d6423SLionel Sambuc 
62433d6423SLionel Sambuc /* exec.c */
63433d6423SLionel Sambuc int pm_exec(vir_bytes path, size_t path_len, vir_bytes frame, size_t frame_len,
64433d6423SLionel Sambuc 	vir_bytes *pc, vir_bytes *newsp, vir_bytes *ps_str);
65433d6423SLionel Sambuc 
66433d6423SLionel Sambuc /* filedes.c */
67433d6423SLionel Sambuc void check_filp_locks(void);
68433d6423SLionel Sambuc void check_filp_locks_by_me(void);
69433d6423SLionel Sambuc void init_filps(void);
70433d6423SLionel Sambuc struct filp *find_filp(struct vnode *vp, mode_t bits);
71433d6423SLionel Sambuc int get_fd(struct fproc *rfp, int start, mode_t bits, int *k,
72433d6423SLionel Sambuc 	struct filp **fpt);
73433d6423SLionel Sambuc struct filp *get_filp(int fild, tll_access_t locktype);
74433d6423SLionel Sambuc struct filp *get_filp2(struct fproc *rfp, int fild, tll_access_t locktype);
75433d6423SLionel Sambuc void lock_filp(struct filp *filp, tll_access_t locktype);
76433d6423SLionel Sambuc void unlock_filp(struct filp *filp);
77433d6423SLionel Sambuc void unlock_filps(struct filp *filp1, struct filp *filp2);
78433d6423SLionel Sambuc void invalidate_filp(struct filp *);
79433d6423SLionel Sambuc void invalidate_filp_by_endpt(endpoint_t proc_e);
803b468884SDavid van Moolenbroek void invalidate_filp_by_char_major(devmajor_t major);
81433d6423SLionel Sambuc void close_filp(struct filp *fp);
82433d6423SLionel Sambuc int do_copyfd(void);
83433d6423SLionel Sambuc 
84433d6423SLionel Sambuc /* fscall.c */
85433d6423SLionel Sambuc void nested_fs_call(message *m);
86433d6423SLionel Sambuc 
87433d6423SLionel Sambuc /* link.c */
88433d6423SLionel Sambuc int do_link(void);
89433d6423SLionel Sambuc int do_unlink(void);
90433d6423SLionel Sambuc int do_rename(void);
91433d6423SLionel Sambuc int do_truncate(void);
92433d6423SLionel Sambuc int do_ftruncate(void);
93433d6423SLionel Sambuc int truncate_vnode(struct vnode *vp, off_t newsize);
94433d6423SLionel Sambuc int rdlink_direct(char *orig_path, char *link_path, struct fproc *rfp);
95433d6423SLionel Sambuc 
96433d6423SLionel Sambuc /* lock.c */
97433d6423SLionel Sambuc int lock_op(struct filp *f, int req);
98433d6423SLionel Sambuc void lock_revive(void);
99433d6423SLionel Sambuc 
100433d6423SLionel Sambuc /* main.c */
101433d6423SLionel Sambuc int main(void);
102433d6423SLionel Sambuc void lock_proc(struct fproc *rfp);
103433d6423SLionel Sambuc void unlock_proc(struct fproc *rfp);
104433d6423SLionel Sambuc void replycode(endpoint_t whom, int result);
105433d6423SLionel Sambuc void service_pm_postponed(void);
106433d6423SLionel Sambuc void thread_cleanup(void);
107433d6423SLionel Sambuc 
108433d6423SLionel Sambuc /* misc.c */
109433d6423SLionel Sambuc void pm_exit(void);
110433d6423SLionel Sambuc int do_fcntl(void);
111433d6423SLionel Sambuc void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid);
112433d6423SLionel Sambuc void pm_setgid(endpoint_t proc_e, int egid, int rgid);
113433d6423SLionel Sambuc void pm_setuid(endpoint_t proc_e, int euid, int ruid);
114433d6423SLionel Sambuc void pm_setgroups(endpoint_t proc_e, int ngroups, gid_t *addr);
115433d6423SLionel Sambuc void pm_setsid(endpoint_t proc_e);
116433d6423SLionel Sambuc int do_sync(void);
117433d6423SLionel Sambuc int do_fsync(void);
118433d6423SLionel Sambuc void pm_reboot(void);
119433d6423SLionel Sambuc int do_svrctl(void);
120433d6423SLionel Sambuc int do_getsysinfo(void);
121433d6423SLionel Sambuc int do_vm_call(void);
122433d6423SLionel Sambuc int pm_dumpcore(int sig, vir_bytes exe_name);
123433d6423SLionel Sambuc void ds_event(void);
124433d6423SLionel Sambuc int dupvm(struct fproc *fp, int pfd, int *vmfd, struct filp **f);
125433d6423SLionel Sambuc int do_getrusage(void);
126433d6423SLionel Sambuc 
127433d6423SLionel Sambuc /* mount.c */
128433d6423SLionel Sambuc int do_mount(void);
129433d6423SLionel Sambuc int do_umount(void);
130433d6423SLionel Sambuc int is_nonedev(dev_t dev);
131433d6423SLionel Sambuc void mount_pfs(void);
132433d6423SLionel Sambuc int mount_fs(dev_t dev, char mount_dev[PATH_MAX], char mount_path[PATH_MAX],
133433d6423SLionel Sambuc 	endpoint_t fs_e, int rdonly, char mount_type[FSTYPE_MAX],
134433d6423SLionel Sambuc 	char mount_label[LABEL_MAX]);
135433d6423SLionel Sambuc int unmount(dev_t dev, char label[LABEL_MAX]);
136433d6423SLionel Sambuc void unmount_all(int force);
137433d6423SLionel Sambuc 
138433d6423SLionel Sambuc /* open.c */
139433d6423SLionel Sambuc int do_close(void);
140433d6423SLionel Sambuc int close_fd(struct fproc *rfp, int fd_nr);
141433d6423SLionel Sambuc int common_open(char path[PATH_MAX], int oflags, mode_t omode);
142433d6423SLionel Sambuc int do_creat(void);
143433d6423SLionel Sambuc int do_lseek(void);
144433d6423SLionel Sambuc int do_mknod(void);
145433d6423SLionel Sambuc int do_mkdir(void);
146433d6423SLionel Sambuc int do_open(void);
147433d6423SLionel Sambuc int do_creat(void);
148433d6423SLionel Sambuc int do_slink(void);
149433d6423SLionel Sambuc int actual_lseek(struct fproc *rfp, int seekfd, int seekwhence, off_t offset,
150433d6423SLionel Sambuc 	off_t *newposp);
151433d6423SLionel Sambuc 
152433d6423SLionel Sambuc /* path.c */
153433d6423SLionel Sambuc struct vnode *advance(struct vnode *dirp, struct lookup *resolve, struct
154433d6423SLionel Sambuc 	fproc *rfp);
155433d6423SLionel Sambuc struct vnode *eat_path(struct lookup *resolve, struct fproc *rfp);
156433d6423SLionel Sambuc struct vnode *last_dir(struct lookup *resolve, struct fproc *rfp);
157433d6423SLionel Sambuc void lookup_init(struct lookup *resolve, char *path, int flags, struct
158433d6423SLionel Sambuc 	vmnt **vmp, struct vnode **vp);
159433d6423SLionel Sambuc int get_name(struct vnode *dirp, struct vnode *entry, char *_name);
160433d6423SLionel Sambuc int canonical_path(char *orig_path, struct fproc *rfp);
161433d6423SLionel Sambuc int do_checkperms(void);
162433d6423SLionel Sambuc 
163433d6423SLionel Sambuc /* pipe.c */
164433d6423SLionel Sambuc int do_pipe2(void);
165433d6423SLionel Sambuc int map_vnode(struct vnode *vp, endpoint_t fs_e);
166433d6423SLionel Sambuc void unpause(void);
167433d6423SLionel Sambuc int pipe_check(struct filp *filp, int rw_flag, int oflags, int bytes,
168433d6423SLionel Sambuc 	int notouch);
169433d6423SLionel Sambuc void release(struct vnode *vp, int op, int count);
170433d6423SLionel Sambuc void revive(endpoint_t proc_e, int returned);
171433d6423SLionel Sambuc void suspend(int why);
172433d6423SLionel Sambuc void pipe_suspend(struct filp *rfilp, vir_bytes buf, size_t size);
173433d6423SLionel Sambuc void unsuspend_by_endpt(endpoint_t proc_e);
174433d6423SLionel Sambuc void wait_for(endpoint_t proc_e);
175433d6423SLionel Sambuc 
176433d6423SLionel Sambuc /* protect.c */
177433d6423SLionel Sambuc int do_access(void);
178433d6423SLionel Sambuc int do_chmod(void);
179433d6423SLionel Sambuc int do_chown(void);
180433d6423SLionel Sambuc int do_umask(void);
181433d6423SLionel Sambuc int forbidden(struct fproc *rfp, struct vnode *vp, mode_t
182433d6423SLionel Sambuc 	access_desired);
183433d6423SLionel Sambuc int read_only(struct vnode *vp);
184433d6423SLionel Sambuc 
185433d6423SLionel Sambuc /* read.c */
186433d6423SLionel Sambuc int do_read(void);
187433d6423SLionel Sambuc int do_getdents(void);
188433d6423SLionel Sambuc void lock_bsf(void);
189433d6423SLionel Sambuc void unlock_bsf(void);
190433d6423SLionel Sambuc void check_bsf_lock(void);
191433d6423SLionel Sambuc int do_read_write_peek(int rw_flag, int fd, vir_bytes buf, size_t bytes);
192433d6423SLionel Sambuc int actual_read_write_peek(struct fproc *rfp, int rw_flag, int fd, vir_bytes buf,
193433d6423SLionel Sambuc 	size_t bytes);
194433d6423SLionel Sambuc int read_write(struct fproc *rfp, int rw_flag, struct filp *f, vir_bytes buffer,
195433d6423SLionel Sambuc 	size_t nbytes, endpoint_t for_e);
196433d6423SLionel Sambuc int rw_pipe(int rw_flag, endpoint_t usr, struct filp *f, vir_bytes buf,
197433d6423SLionel Sambuc 	size_t req_size);
198433d6423SLionel Sambuc 
199433d6423SLionel Sambuc /* request.c */
200433d6423SLionel Sambuc int req_breadwrite(endpoint_t fs_e, endpoint_t user_e, dev_t dev, off_t pos,
201433d6423SLionel Sambuc 	unsigned int num_of_bytes, vir_bytes user_addr, int rw_flag,
2023c8950ccSBen Gras 	off_t *new_posp, size_t *cum_iop);
203433d6423SLionel Sambuc int req_chmod(endpoint_t fs_e, ino_t inode_nr, mode_t rmode,
204433d6423SLionel Sambuc 	mode_t *new_modep);
205433d6423SLionel Sambuc int req_chown(endpoint_t fs_e, ino_t inode_nr, uid_t newuid, gid_t newgid,
206433d6423SLionel Sambuc 	mode_t *new_modep);
207433d6423SLionel Sambuc int req_create(endpoint_t fs_e, ino_t inode_nr, int omode, uid_t uid,
208433d6423SLionel Sambuc 	gid_t gid, char *path, node_details_t *res);
209433d6423SLionel Sambuc int req_flush(endpoint_t fs_e, dev_t dev);
210433d6423SLionel Sambuc int req_statvfs(endpoint_t fs_e, struct statvfs *buf);
211433d6423SLionel Sambuc int req_ftrunc(endpoint_t fs_e, ino_t inode_nr, off_t start, off_t end);
212433d6423SLionel Sambuc int req_getdents(endpoint_t fs_e, ino_t inode_nr, off_t pos, vir_bytes buf,
213433d6423SLionel Sambuc 	size_t size, off_t *new_pos, int direct);
214433d6423SLionel Sambuc int req_inhibread(endpoint_t fs_e, ino_t inode_nr);
215433d6423SLionel Sambuc int req_link(endpoint_t fs_e, ino_t link_parent, char *lastc,
216433d6423SLionel Sambuc 	ino_t linked_file);
217433d6423SLionel Sambuc int req_lookup(endpoint_t fs_e, ino_t dir_ino, ino_t root_ino, uid_t uid,
218433d6423SLionel Sambuc 	gid_t gid, struct lookup *resolve, lookup_res_t *res,
219433d6423SLionel Sambuc 	struct fproc *rfp);
220433d6423SLionel Sambuc int req_mkdir(endpoint_t fs_e, ino_t inode_nr, char *lastc, uid_t uid,
221433d6423SLionel Sambuc 	gid_t gid, mode_t dmode);
222433d6423SLionel Sambuc int req_mknod(endpoint_t fs_e, ino_t inode_nr, char *lastc, uid_t uid,
223433d6423SLionel Sambuc 	gid_t gid, mode_t dmode, dev_t dev);
224433d6423SLionel Sambuc int req_mountpoint(endpoint_t fs_e, ino_t inode_nr);
225433d6423SLionel Sambuc int req_newnode(endpoint_t fs_e, uid_t uid, gid_t gid, mode_t dmode,
226433d6423SLionel Sambuc 	dev_t dev, struct node_details *res);
227433d6423SLionel Sambuc int req_putnode(int fs_e, ino_t inode_nr, int count);
228433d6423SLionel Sambuc int req_rdlink(endpoint_t fs_e, ino_t inode_nr, endpoint_t proc_e,
229433d6423SLionel Sambuc 	vir_bytes buf, size_t len, int direct);
230433d6423SLionel Sambuc int req_readsuper(struct vmnt *vmp, char *driver_name, dev_t dev, int readonly,
231433d6423SLionel Sambuc 	int isroot, struct node_details *res_nodep, unsigned int *fs_flags);
232433d6423SLionel Sambuc int req_readwrite(endpoint_t fs_e, ino_t inode_nr, off_t pos, int rw_flag,
233433d6423SLionel Sambuc 	endpoint_t user_e, vir_bytes user_addr, unsigned int num_of_bytes,
2343c8950ccSBen Gras 	off_t *new_posp, size_t *cum_iop);
235433d6423SLionel Sambuc int req_bpeek(endpoint_t fs_e, dev_t dev, off_t pos, unsigned int num_of_bytes);
236433d6423SLionel Sambuc int req_peek(endpoint_t fs_e, ino_t inode_nr, off_t pos, unsigned int bytes);
237433d6423SLionel Sambuc int req_rename(endpoint_t fs_e, ino_t old_dir, char *old_name, ino_t new_dir,
238433d6423SLionel Sambuc 	char *new_name);
239433d6423SLionel Sambuc int req_rmdir(endpoint_t fs_e, ino_t inode_nr, char *lastc);
240433d6423SLionel Sambuc int req_slink(endpoint_t fs_e, ino_t inode_nr, char *lastc, endpoint_t proc_e,
241433d6423SLionel Sambuc 	vir_bytes path_addr, size_t path_length, uid_t uid, gid_t gid);
242433d6423SLionel Sambuc int req_stat(endpoint_t fs_e, ino_t inode_nr, endpoint_t proc_e, vir_bytes buf);
243433d6423SLionel Sambuc int req_sync(endpoint_t fs_e);
244433d6423SLionel Sambuc int req_unlink(endpoint_t fs_e, ino_t inode_nr, char *lastc);
245433d6423SLionel Sambuc int req_unmount(endpoint_t fs_e);
246433d6423SLionel Sambuc int req_utime(endpoint_t fs_e, ino_t inode_nr, struct timespec * actv,
247433d6423SLionel Sambuc 	struct timespec * modtv);
248433d6423SLionel Sambuc int req_newdriver(endpoint_t fs_e, dev_t dev, char *label);
249433d6423SLionel Sambuc 
250433d6423SLionel Sambuc /* stadir.c */
251433d6423SLionel Sambuc int do_chdir(void);
252433d6423SLionel Sambuc int do_fchdir(void);
253433d6423SLionel Sambuc int do_chroot(void);
254433d6423SLionel Sambuc int do_fstat(void);
255433d6423SLionel Sambuc int do_stat(void);
256433d6423SLionel Sambuc int do_statvfs(void);
257433d6423SLionel Sambuc int do_fstatvfs(void);
258433d6423SLionel Sambuc int do_getvfsstat(void);
259433d6423SLionel Sambuc int do_rdlink(void);
260433d6423SLionel Sambuc int do_lstat(void);
261433d6423SLionel Sambuc int update_statvfs(struct vmnt *vmp, struct statvfs *buf);
262433d6423SLionel Sambuc 
263433d6423SLionel Sambuc /* time.c */
264433d6423SLionel Sambuc int do_utimens(void);
265433d6423SLionel Sambuc 
266433d6423SLionel Sambuc /* tll.c */
267433d6423SLionel Sambuc void tll_downgrade(tll_t *tllp);
268433d6423SLionel Sambuc int tll_haspendinglock(tll_t *tllp);
269433d6423SLionel Sambuc void tll_init(tll_t *tllp);
270433d6423SLionel Sambuc int tll_islocked(tll_t *tllp);
271433d6423SLionel Sambuc int tll_lock(tll_t *tllp, tll_access_t locktype);
272433d6423SLionel Sambuc int tll_locked_by_me(tll_t *tllp);
273433d6423SLionel Sambuc void tll_lockstat(tll_t *tllp);
274433d6423SLionel Sambuc int tll_unlock(tll_t *tllp);
275433d6423SLionel Sambuc void tll_upgrade(tll_t *tllp);
276433d6423SLionel Sambuc 
277433d6423SLionel Sambuc /* utility.c */
278433d6423SLionel Sambuc int copy_path(char *dest, size_t size);
279433d6423SLionel Sambuc int fetch_name(vir_bytes path, size_t len, char *dest);
280433d6423SLionel Sambuc int isokendpt_f(const char *f, int l, endpoint_t e, int *p, int ft);
281433d6423SLionel Sambuc int in_group(struct fproc *rfp, gid_t grp);
282433d6423SLionel Sambuc int sys_datacopy_wrapper(endpoint_t src, vir_bytes srcv, endpoint_t dst, vir_bytes dstv,
283433d6423SLionel Sambuc 	size_t len);
284433d6423SLionel Sambuc 
285433d6423SLionel Sambuc #define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
286433d6423SLionel Sambuc #define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
287433d6423SLionel Sambuc 
288433d6423SLionel Sambuc /* vmnt.c */
289433d6423SLionel Sambuc void check_vmnt_locks(void);
290433d6423SLionel Sambuc void check_vmnt_locks_by_me(struct fproc *rfp);
291433d6423SLionel Sambuc void mark_vmnt_free(struct vmnt *vmp);
292433d6423SLionel Sambuc struct vmnt *get_free_vmnt(void);
293433d6423SLionel Sambuc struct vmnt *find_vmnt(endpoint_t fs_e);
294433d6423SLionel Sambuc struct vmnt *get_locked_vmnt(struct fproc *rfp);
295433d6423SLionel Sambuc void init_vmnts(void);
296433d6423SLionel Sambuc int lock_vmnt(struct vmnt *vp, tll_access_t locktype);
297433d6423SLionel Sambuc void unlock_vmnt(struct vmnt *vp);
298433d6423SLionel Sambuc void vmnt_unmap_by_endpt(endpoint_t proc_e);
299433d6423SLionel Sambuc void fetch_vmnt_paths(void);
300433d6423SLionel Sambuc void upgrade_vmnt_lock(struct vmnt *vmp);
301433d6423SLionel Sambuc void downgrade_vmnt_lock(struct vmnt *vmp);
302433d6423SLionel Sambuc 
303433d6423SLionel Sambuc /* vnode.c */
304433d6423SLionel Sambuc void check_vnode_locks(void);
305433d6423SLionel Sambuc void check_vnode_locks_by_me(struct fproc *rfp);
306433d6423SLionel Sambuc struct vnode *get_free_vnode(void);
307433d6423SLionel Sambuc struct vnode *find_vnode(int fs_e, ino_t inode);
308433d6423SLionel Sambuc void init_vnodes(void);
309433d6423SLionel Sambuc int is_vnode_locked(struct vnode *vp);
310433d6423SLionel Sambuc int lock_vnode(struct vnode *vp, tll_access_t locktype);
311433d6423SLionel Sambuc void unlock_vnode(struct vnode *vp);
312433d6423SLionel Sambuc void dup_vnode(struct vnode *vp);
313433d6423SLionel Sambuc void put_vnode(struct vnode *vp);
314433d6423SLionel Sambuc void vnode_clean_refs(struct vnode *vp);
315433d6423SLionel Sambuc void upgrade_vnode_lock(struct vnode *vp);
316433d6423SLionel Sambuc 
317433d6423SLionel Sambuc /* write.c */
318433d6423SLionel Sambuc int do_write(void);
319433d6423SLionel Sambuc 
320433d6423SLionel Sambuc /* gcov.c */
321433d6423SLionel Sambuc int do_gcov_flush(void);
322433d6423SLionel Sambuc #if ! USE_COVERAGE
323433d6423SLionel Sambuc #define do_gcov_flush NULL
324433d6423SLionel Sambuc #endif
325433d6423SLionel Sambuc 
326433d6423SLionel Sambuc /* select.c */
327433d6423SLionel Sambuc int do_select(void);
328433d6423SLionel Sambuc void init_select(void);
329433d6423SLionel Sambuc void select_callback(struct filp *, int ops);
330433d6423SLionel Sambuc void select_forget(void);
3313b468884SDavid van Moolenbroek void select_reply1(endpoint_t driver_e, devminor_t minor, int status);
3323b468884SDavid van Moolenbroek void select_reply2(endpoint_t driver_e, devminor_t minor, int status);
333433d6423SLionel Sambuc void select_timeout_check(minix_timer_t *);
334433d6423SLionel Sambuc void select_unsuspend_by_endpt(endpoint_t proc);
335433d6423SLionel Sambuc 
336433d6423SLionel Sambuc /* worker.c */
337433d6423SLionel Sambuc void worker_init(void);
338433d6423SLionel Sambuc int worker_available(void);
339*7eb698eaSDavid van Moolenbroek void worker_allow(int allow);
340433d6423SLionel Sambuc struct worker_thread *worker_get(thread_t worker_tid);
341433d6423SLionel Sambuc void worker_signal(struct worker_thread *worker);
342433d6423SLionel Sambuc int worker_can_start(struct fproc *rfp);
343433d6423SLionel Sambuc void worker_start(struct fproc *rfp, void (*func)(void), message *m_ptr,
344433d6423SLionel Sambuc 	int use_spare);
345433d6423SLionel Sambuc void worker_stop(struct worker_thread *worker);
346433d6423SLionel Sambuc void worker_stop_by_endpt(endpoint_t proc_e);
347433d6423SLionel Sambuc void worker_wait(void);
348433d6423SLionel Sambuc struct worker_thread *worker_suspend(void);
349433d6423SLionel Sambuc void worker_resume(struct worker_thread *org_self);
350433d6423SLionel Sambuc void worker_set_proc(struct fproc *rfp);
351433d6423SLionel Sambuc #endif
352