xref: /minix3/minix/servers/vfs/table.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /* This file contains the table used to map system call numbers onto the
2*433d6423SLionel Sambuc  * routines that perform them.
3*433d6423SLionel Sambuc  */
4*433d6423SLionel Sambuc 
5*433d6423SLionel Sambuc #define _TABLE
6*433d6423SLionel Sambuc 
7*433d6423SLionel Sambuc #include "fs.h"
8*433d6423SLionel Sambuc #include <minix/callnr.h>
9*433d6423SLionel Sambuc #include <minix/com.h>
10*433d6423SLionel Sambuc #include "file.h"
11*433d6423SLionel Sambuc #include "lock.h"
12*433d6423SLionel Sambuc #include "scratchpad.h"
13*433d6423SLionel Sambuc #include "vnode.h"
14*433d6423SLionel Sambuc #include "vmnt.h"
15*433d6423SLionel Sambuc 
16*433d6423SLionel Sambuc #define CALL(n) [((n) - VFS_BASE)]
17*433d6423SLionel Sambuc 
18*433d6423SLionel Sambuc int (* const call_vec[NR_VFS_CALLS])(void) = {
19*433d6423SLionel Sambuc 	CALL(VFS_READ)		= do_read,		/* read(2) */
20*433d6423SLionel Sambuc 	CALL(VFS_WRITE)		= do_write,		/* write(2) */
21*433d6423SLionel Sambuc 	CALL(VFS_LSEEK)		= do_lseek,		/* lseek(2) */
22*433d6423SLionel Sambuc 	CALL(VFS_OPEN)		= do_open,		/* open(2) */
23*433d6423SLionel Sambuc 	CALL(VFS_CREAT)		= do_creat,		/* creat(2) */
24*433d6423SLionel Sambuc 	CALL(VFS_CLOSE)		= do_close,		/* close(2) */
25*433d6423SLionel Sambuc 	CALL(VFS_LINK)		= do_link,		/* link(2) */
26*433d6423SLionel Sambuc 	CALL(VFS_UNLINK)	= do_unlink,		/* unlink(2) */
27*433d6423SLionel Sambuc 	CALL(VFS_CHDIR)		= do_chdir,		/* chdir(2) */
28*433d6423SLionel Sambuc 	CALL(VFS_MKDIR)		= do_mkdir,		/* mkdir(2) */
29*433d6423SLionel Sambuc 	CALL(VFS_MKNOD)		= do_mknod,		/* mknod(2) */
30*433d6423SLionel Sambuc 	CALL(VFS_CHMOD)		= do_chmod,		/* chmod(2) */
31*433d6423SLionel Sambuc 	CALL(VFS_CHOWN)		= do_chown,		/* chown(2) */
32*433d6423SLionel Sambuc 	CALL(VFS_MOUNT)		= do_mount,		/* mount(2) */
33*433d6423SLionel Sambuc 	CALL(VFS_UMOUNT)	= do_umount,		/* umount(2) */
34*433d6423SLionel Sambuc 	CALL(VFS_ACCESS)	= do_access,		/* access(2) */
35*433d6423SLionel Sambuc 	CALL(VFS_SYNC)		= do_sync,		/* sync(2) */
36*433d6423SLionel Sambuc 	CALL(VFS_RENAME)	= do_rename,		/* rename(2) */
37*433d6423SLionel Sambuc 	CALL(VFS_RMDIR)		= do_unlink,		/* rmdir(2) */
38*433d6423SLionel Sambuc 	CALL(VFS_SYMLINK)	= do_slink,		/* symlink(2) */
39*433d6423SLionel Sambuc 	CALL(VFS_READLINK)	= do_rdlink,		/* readlink(2) */
40*433d6423SLionel Sambuc 	CALL(VFS_STAT)		= do_stat,		/* stat(2) */
41*433d6423SLionel Sambuc 	CALL(VFS_FSTAT)		= do_fstat,		/* fstat(2) */
42*433d6423SLionel Sambuc 	CALL(VFS_LSTAT)		= do_lstat,		/* lstat(2) */
43*433d6423SLionel Sambuc 	CALL(VFS_IOCTL)		= do_ioctl,		/* ioctl(2) */
44*433d6423SLionel Sambuc 	CALL(VFS_FCNTL)		= do_fcntl,		/* fcntl(2) */
45*433d6423SLionel Sambuc 	CALL(VFS_PIPE2)		= do_pipe2,		/* pipe2(2) */
46*433d6423SLionel Sambuc 	CALL(VFS_UMASK)		= do_umask,		/* umask(2) */
47*433d6423SLionel Sambuc 	CALL(VFS_CHROOT)	= do_chroot,		/* chroot(2) */
48*433d6423SLionel Sambuc 	CALL(VFS_GETDENTS)	= do_getdents,		/* getdents(2) */
49*433d6423SLionel Sambuc 	CALL(VFS_SELECT)	= do_select,		/* select(2) */
50*433d6423SLionel Sambuc 	CALL(VFS_FCHDIR)	= do_fchdir,		/* fchdir(2) */
51*433d6423SLionel Sambuc 	CALL(VFS_FSYNC)		= do_fsync,		/* fsync(2) */
52*433d6423SLionel Sambuc 	CALL(VFS_TRUNCATE)	= do_truncate,		/* truncate(2) */
53*433d6423SLionel Sambuc 	CALL(VFS_FTRUNCATE)	= do_ftruncate,		/* ftruncate(2) */
54*433d6423SLionel Sambuc 	CALL(VFS_FCHMOD)	= do_chmod,		/* fchmod(2) */
55*433d6423SLionel Sambuc 	CALL(VFS_FCHOWN)	= do_chown,		/* fchown(2) */
56*433d6423SLionel Sambuc 	CALL(VFS_UTIMENS)	= do_utimens,		/* [fl]utime[n]s(2) */
57*433d6423SLionel Sambuc 	CALL(VFS_VMCALL)	= do_vm_call,
58*433d6423SLionel Sambuc 	CALL(VFS_GETVFSSTAT)	= do_getvfsstat,	/* getvfsstat(2) */
59*433d6423SLionel Sambuc 	CALL(VFS_STATVFS1)	= do_statvfs,		/* statvfs(2) */
60*433d6423SLionel Sambuc 	CALL(VFS_FSTATVFS1)	= do_fstatvfs,		/* fstatvfs(2) */
61*433d6423SLionel Sambuc 	CALL(VFS_GETRUSAGE)	= do_getrusage,		/* getrusage(2) */
62*433d6423SLionel Sambuc 	CALL(VFS_SVRCTL)	= do_svrctl,		/* svrctl(2) */
63*433d6423SLionel Sambuc 	CALL(VFS_GCOV_FLUSH)	= do_gcov_flush,	/* gcov_flush(2) */
64*433d6423SLionel Sambuc 	CALL(VFS_MAPDRIVER)	= do_mapdriver,		/* mapdriver(2) */
65*433d6423SLionel Sambuc 	CALL(VFS_COPYFD)	= do_copyfd,		/* copyfd(2) */
66*433d6423SLionel Sambuc 	CALL(VFS_CHECKPERMS)	= do_checkperms,	/* checkperms(2) */
67*433d6423SLionel Sambuc 	CALL(VFS_GETSYSINFO)	= do_getsysinfo,	/* getsysinfo(2) */
68*433d6423SLionel Sambuc };
69