2005-04-21 16:53:53 +02:00
|
|
|
/* Function prototypes. */
|
|
|
|
|
2005-06-17 15:41:12 +02:00
|
|
|
#include "timers.h"
|
2006-10-25 15:40:36 +02:00
|
|
|
#include "request.h"
|
2010-04-09 23:56:44 +02:00
|
|
|
#include <minix/rs.h>
|
2006-06-20 12:12:09 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* Structs used in prototypes must be declared as such first. */
|
|
|
|
struct filp;
|
2006-05-11 16:57:23 +02:00
|
|
|
struct fproc;
|
2006-10-25 15:40:36 +02:00
|
|
|
struct vmnt;
|
|
|
|
struct vnode;
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2010-08-30 15:44:07 +02:00
|
|
|
typedef struct filp * filp_id_t;
|
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* device.c */
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int dev_open, (dev_t dev, int proc, int flags) );
|
|
|
|
_PROTOTYPE( int dev_reopen, (dev_t dev, int filp_no, int flags) );
|
|
|
|
_PROTOTYPE( int dev_close, (dev_t dev, int filp_no) );
|
Split block/character protocols and libdriver
This patch separates the character and block driver communication
protocols. The old character protocol remains the same, but a new
block protocol is introduced. The libdriver library is replaced by
two new libraries: libchardriver and libblockdriver. Their exposed
API, and drivers that use them, have been updated accordingly.
Together, libbdev and libblockdriver now completely abstract away
the message format used by the block protocol. As the memory driver
is both a character and a block device driver, it now implements its
own message loop.
The most important semantic change made to the block protocol is that
it is no longer possible to return both partial results and an error
for a single transfer. This simplifies the interaction between the
caller and the driver, as the I/O vector no longer needs to be copied
back. Also, drivers are now no longer supposed to decide based on the
layout of the I/O vector when a transfer should be cut short. Put
simply, transfers are now supposed to either succeed completely, or
result in an error.
After this patch, the state of the various pieces is as follows:
- block protocol: stable
- libbdev API: stable for synchronous communication
- libblockdriver API: needs slight revision (the drvlib/partition API
in particular; the threading API will also change shortly)
- character protocol: needs cleanup
- libchardriver API: needs cleanup accordingly
- driver restarts: largely unsupported until endpoint changes are
reintroduced
As a side effect, this patch eliminates several bugs, hacks, and gcc
-Wall and -W warnings all over the place. It probably introduces a
few new ones, too.
Update warning: this patch changes the protocol between MFS and disk
drivers, so in order to use old/new images, the MFS from the ramdisk
must be used to mount all file systems.
2011-11-22 13:27:53 +01:00
|
|
|
_PROTOTYPE( int bdev_open, (dev_t dev, int flags) );
|
|
|
|
_PROTOTYPE( int bdev_close, (dev_t dev) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int dev_io, (int op, dev_t dev, int proc, void *buf,
|
dev_close needs the filp number for asynch I/O, dev_io gets suspend_reopen
flag to suspend a process until the filedescriptor is re-opened. Added
dev_reopen, asyn_io, suspended_ep, reopen_reply, asynsend, diag_repl,
close_filp, close_reply, unpause, select_reply1, select_reply2.
2008-02-22 15:03:14 +01:00
|
|
|
u64_t pos, int bytes, int flags, int suspend_reopen) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int gen_opcl, (int op, dev_t dev, int proc, int flags) );
|
2006-03-15 14:37:20 +01:00
|
|
|
_PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) );
|
dev_close needs the filp number for asynch I/O, dev_io gets suspend_reopen
flag to suspend a process until the filedescriptor is re-opened. Added
dev_reopen, asyn_io, suspended_ep, reopen_reply, asynsend, diag_repl,
close_filp, close_reply, unpause, select_reply1, select_reply2.
2008-02-22 15:03:14 +01:00
|
|
|
_PROTOTYPE( int asyn_io, (int task_nr, message *mess_ptr) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int no_dev, (int op, dev_t dev, int proc, int flags) );
|
2006-03-15 14:37:20 +01:00
|
|
|
_PROTOTYPE( int no_dev_io, (int, message *) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int tty_opcl, (int op, dev_t dev, int proc, int flags) );
|
|
|
|
_PROTOTYPE( int ctty_opcl, (int op, dev_t dev, int proc, int flags) );
|
|
|
|
_PROTOTYPE( int clone_opcl, (int op, dev_t dev, int proc, int flags) );
|
2006-03-15 14:37:20 +01:00
|
|
|
_PROTOTYPE( int ctty_io, (int task_nr, message *mess_ptr) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_ioctl, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( void pm_setsid, (int proc_e) );
|
2005-08-02 17:29:17 +02:00
|
|
|
_PROTOTYPE( void dev_status, (message *) );
|
Split block/character protocols and libdriver
This patch separates the character and block driver communication
protocols. The old character protocol remains the same, but a new
block protocol is introduced. The libdriver library is replaced by
two new libraries: libchardriver and libblockdriver. Their exposed
API, and drivers that use them, have been updated accordingly.
Together, libbdev and libblockdriver now completely abstract away
the message format used by the block protocol. As the memory driver
is both a character and a block device driver, it now implements its
own message loop.
The most important semantic change made to the block protocol is that
it is no longer possible to return both partial results and an error
for a single transfer. This simplifies the interaction between the
caller and the driver, as the I/O vector no longer needs to be copied
back. Also, drivers are now no longer supposed to decide based on the
layout of the I/O vector when a transfer should be cut short. Put
simply, transfers are now supposed to either succeed completely, or
result in an error.
After this patch, the state of the various pieces is as follows:
- block protocol: stable
- libbdev API: stable for synchronous communication
- libblockdriver API: needs slight revision (the drvlib/partition API
in particular; the threading API will also change shortly)
- character protocol: needs cleanup
- libchardriver API: needs cleanup accordingly
- driver restarts: largely unsupported until endpoint changes are
reintroduced
As a side effect, this patch eliminates several bugs, hacks, and gcc
-Wall and -W warnings all over the place. It probably introduces a
few new ones, too.
Update warning: this patch changes the protocol between MFS and disk
drivers, so in order to use old/new images, the MFS from the ramdisk
must be used to mount all file systems.
2011-11-22 13:27:53 +01:00
|
|
|
_PROTOTYPE( void bdev_up, (int major) );
|
|
|
|
_PROTOTYPE( void cdev_up, (int major) );
|
dev_close needs the filp number for asynch I/O, dev_io gets suspend_reopen
flag to suspend a process until the filedescriptor is re-opened. Added
dev_reopen, asyn_io, suspended_ep, reopen_reply, asynsend, diag_repl,
close_filp, close_reply, unpause, select_reply1, select_reply2.
2008-02-22 15:03:14 +01:00
|
|
|
_PROTOTYPE( endpoint_t suspended_ep, (endpoint_t driver,
|
|
|
|
cp_grant_id_t g) );
|
|
|
|
_PROTOTYPE( void reopen_reply, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* dmap.c */
|
2005-08-05 20:57:20 +02:00
|
|
|
_PROTOTYPE( void build_dmap, (void) );
|
2011-04-13 15:25:34 +02:00
|
|
|
_PROTOTYPE( int do_mapdriver, (void) );
|
2009-09-22 23:48:26 +02:00
|
|
|
_PROTOTYPE( int dmap_driver_match, (endpoint_t proc, int major) );
|
Split block/character protocols and libdriver
This patch separates the character and block driver communication
protocols. The old character protocol remains the same, but a new
block protocol is introduced. The libdriver library is replaced by
two new libraries: libchardriver and libblockdriver. Their exposed
API, and drivers that use them, have been updated accordingly.
Together, libbdev and libblockdriver now completely abstract away
the message format used by the block protocol. As the memory driver
is both a character and a block device driver, it now implements its
own message loop.
The most important semantic change made to the block protocol is that
it is no longer possible to return both partial results and an error
for a single transfer. This simplifies the interaction between the
caller and the driver, as the I/O vector no longer needs to be copied
back. Also, drivers are now no longer supposed to decide based on the
layout of the I/O vector when a transfer should be cut short. Put
simply, transfers are now supposed to either succeed completely, or
result in an error.
After this patch, the state of the various pieces is as follows:
- block protocol: stable
- libbdev API: stable for synchronous communication
- libblockdriver API: needs slight revision (the drvlib/partition API
in particular; the threading API will also change shortly)
- character protocol: needs cleanup
- libchardriver API: needs cleanup accordingly
- driver restarts: largely unsupported until endpoint changes are
reintroduced
As a side effect, this patch eliminates several bugs, hacks, and gcc
-Wall and -W warnings all over the place. It probably introduces a
few new ones, too.
Update warning: this patch changes the protocol between MFS and disk
drivers, so in order to use old/new images, the MFS from the ramdisk
must be used to mount all file systems.
2011-11-22 13:27:53 +01:00
|
|
|
_PROTOTYPE( void dmap_endpt_up, (int proc_nr, int is_blk) );
|
2011-04-13 15:25:34 +02:00
|
|
|
_PROTOTYPE( void dmap_unmap_by_endpt, (int proc_nr) );
|
|
|
|
_PROTOTYPE( struct dmap *get_dmap, (endpoint_t proc_e) );
|
|
|
|
_PROTOTYPE( int map_driver, (const char *label, int major, endpoint_t proc_nr,
|
|
|
|
int dev_style, int flags) );
|
|
|
|
_PROTOTYPE( int map_service, (struct rprocpub *rpub) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2006-05-11 16:57:23 +02:00
|
|
|
/* exec.c */
|
|
|
|
_PROTOTYPE( int pm_exec, (int proc_e, char *path, vir_bytes path_len,
|
2010-06-10 16:59:10 +02:00
|
|
|
char *frame, vir_bytes frame_len, vir_bytes *pc));
|
2006-05-11 16:57:23 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* filedes.c */
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( struct filp *find_filp, (struct vnode *vp, mode_t bits) );
|
|
|
|
_PROTOTYPE( int get_fd, (int start, mode_t bits, int *k,
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
struct filp **fpt) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( struct filp *get_filp, (int fild) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( struct filp *get_filp2, (struct fproc *rfp, int fild) );
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
_PROTOTYPE( int invalidate, (struct filp *) );
|
2010-08-30 15:44:07 +02:00
|
|
|
_PROTOTYPE( filp_id_t verify_fd, (endpoint_t ep, int fd) );
|
|
|
|
_PROTOTYPE( int do_verify_fd, (void) );
|
|
|
|
_PROTOTYPE( int set_filp, (filp_id_t sfilp) );
|
|
|
|
_PROTOTYPE( int do_set_filp, (void) );
|
|
|
|
_PROTOTYPE( int copy_filp, (endpoint_t to_ep, filp_id_t cfilp) );
|
|
|
|
_PROTOTYPE( int do_copy_filp, (void) );
|
|
|
|
_PROTOTYPE( int put_filp, (filp_id_t pfilp) );
|
|
|
|
_PROTOTYPE( int do_put_filp, (void) );
|
|
|
|
_PROTOTYPE( int cancel_fd, (endpoint_t ep, int fd) );
|
|
|
|
_PROTOTYPE( int do_cancel_fd, (void) );
|
|
|
|
_PROTOTYPE( void close_filp, (struct filp *fp) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
2009-05-11 12:02:28 +02:00
|
|
|
/* fscall.c */
|
|
|
|
_PROTOTYPE( void nested_fs_call, (message *m) );
|
2010-08-30 15:44:07 +02:00
|
|
|
_PROTOTYPE( void nested_dev_call, (message *m) );
|
2009-05-11 12:02:28 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* link.c */
|
|
|
|
_PROTOTYPE( int do_link, (void) );
|
|
|
|
_PROTOTYPE( int do_unlink, (void) );
|
|
|
|
_PROTOTYPE( int do_rename, (void) );
|
2006-01-11 18:14:51 +01:00
|
|
|
_PROTOTYPE( int do_truncate, (void) );
|
|
|
|
_PROTOTYPE( int do_ftruncate, (void) );
|
2010-08-30 15:44:07 +02:00
|
|
|
_PROTOTYPE( int truncate_vnode, (struct vnode *vp, off_t newsize) );
|
|
|
|
_PROTOTYPE( int rdlink_direct, (char *orig_path, char *link_path,
|
|
|
|
struct fproc *rfp) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* lock.c */
|
|
|
|
_PROTOTYPE( int lock_op, (struct filp *f, int req) );
|
|
|
|
_PROTOTYPE( void lock_revive, (void) );
|
|
|
|
|
|
|
|
/* main.c */
|
2005-08-25 14:30:43 +02:00
|
|
|
_PROTOTYPE( int main, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( void reply, (int whom, int result) );
|
|
|
|
|
|
|
|
/* misc.c */
|
|
|
|
_PROTOTYPE( int do_dup, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( void pm_exit, (int proc) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_fcntl, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( void pm_fork, (int pproc, int cproc, int cpid) );
|
|
|
|
_PROTOTYPE( void pm_setgid, (int proc_e, int egid, int rgid) );
|
|
|
|
_PROTOTYPE( void pm_setuid, (int proc_e, int euid, int ruid) );
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
_PROTOTYPE( void pm_setgroups, (int proc_e, int ngroups, gid_t *addr) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_sync, (void) );
|
2005-09-11 18:45:46 +02:00
|
|
|
_PROTOTYPE( int do_fsync, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( void pm_reboot, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_svrctl, (void) );
|
|
|
|
_PROTOTYPE( int do_getsysinfo, (void) );
|
2011-07-30 08:03:23 +02:00
|
|
|
_PROTOTYPE( int pm_dumpcore, (int proc_e, int sig, char *exe_name) );
|
2010-04-08 15:41:35 +02:00
|
|
|
_PROTOTYPE( void ds_event, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* mount.c */
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( int do_fslogin, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_mount, (void) );
|
|
|
|
_PROTOTYPE( int do_umount, (void) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int unmount, (dev_t dev, char *label) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* open.c */
|
|
|
|
_PROTOTYPE( int do_close, (void) );
|
2006-05-11 16:57:23 +02:00
|
|
|
_PROTOTYPE( int close_fd, (struct fproc *rfp, int fd_nr) );
|
dev_close needs the filp number for asynch I/O, dev_io gets suspend_reopen
flag to suspend a process until the filedescriptor is re-opened. Added
dev_reopen, asyn_io, suspended_ep, reopen_reply, asynsend, diag_repl,
close_filp, close_reply, unpause, select_reply1, select_reply2.
2008-02-22 15:03:14 +01:00
|
|
|
_PROTOTYPE( void close_reply, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_creat, (void) );
|
|
|
|
_PROTOTYPE( int do_lseek, (void) );
|
2006-11-27 15:21:43 +01:00
|
|
|
_PROTOTYPE( int do_llseek, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_mknod, (void) );
|
|
|
|
_PROTOTYPE( int do_mkdir, (void) );
|
|
|
|
_PROTOTYPE( int do_open, (void) );
|
2011-07-30 08:03:23 +02:00
|
|
|
_PROTOTYPE( int common_open, (register int oflags, mode_t omode) );
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( int do_slink, (void) );
|
2008-11-19 13:26:10 +01:00
|
|
|
_PROTOTYPE( int do_vm_open, (void) );
|
|
|
|
_PROTOTYPE( int do_vm_close, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* path.c */
|
2010-08-30 15:44:07 +02:00
|
|
|
_PROTOTYPE( struct vnode *advance, (struct vnode *dirp, int flags,
|
|
|
|
struct fproc *rfp) );
|
|
|
|
_PROTOTYPE( struct vnode *eat_path, (int flags, struct fproc *rfp) );
|
|
|
|
_PROTOTYPE( struct vnode *last_dir, (struct fproc *rfp) );
|
|
|
|
_PROTOTYPE( int get_name, (struct vnode *dirp, struct vnode *entry,
|
|
|
|
char *_name) );
|
|
|
|
_PROTOTYPE( int canonical_path, (char *orig_path, char *canon_path,
|
|
|
|
struct fproc *rfp) );
|
|
|
|
_PROTOTYPE( int check_perms, (endpoint_t ep, cp_grant_id_t gid,
|
|
|
|
int strlen) );
|
|
|
|
_PROTOTYPE( int do_check_perms, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* pipe.c */
|
|
|
|
_PROTOTYPE( int do_pipe, (void) );
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
_PROTOTYPE( int map_vnode, (struct vnode *vp) );
|
dev_close needs the filp number for asynch I/O, dev_io gets suspend_reopen
flag to suspend a process until the filedescriptor is re-opened. Added
dev_reopen, asyn_io, suspended_ep, reopen_reply, asynsend, diag_repl,
close_filp, close_reply, unpause, select_reply1, select_reply2.
2008-02-22 15:03:14 +01:00
|
|
|
_PROTOTYPE( void unpause, (int proc_nr_e) );
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
_PROTOTYPE( int pipe_check, (struct vnode *vp, int rw_flag,
|
2007-08-07 14:52:47 +02:00
|
|
|
int oflags, int bytes, u64_t position, int notouch) );
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( void release, (struct vnode *vp, int call_nr, int count) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( void revive, (int proc_nr, int bytes) );
|
|
|
|
_PROTOTYPE( void suspend, (int task) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( void pipe_suspend, (int rw_flag, int fd_nr, char *buf,
|
|
|
|
size_t size) );
|
2009-09-22 23:48:26 +02:00
|
|
|
_PROTOTYPE( void unsuspend_by_endpt, (endpoint_t) );
|
2009-10-05 18:43:02 +02:00
|
|
|
_PROTOTYPE( void wait_for, (endpoint_t) );
|
2009-05-08 15:56:41 +02:00
|
|
|
#if DO_SANITYCHECKS
|
|
|
|
_PROTOTYPE( int check_pipe, (void) );
|
|
|
|
#endif
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* protect.c */
|
|
|
|
_PROTOTYPE( int do_access, (void) );
|
|
|
|
_PROTOTYPE( int do_chmod, (void) );
|
|
|
|
_PROTOTYPE( int do_chown, (void) );
|
|
|
|
_PROTOTYPE( int do_umask, (void) );
|
2012-01-27 17:06:43 +01:00
|
|
|
_PROTOTYPE( int forbidden, (struct fproc *rfp, struct vnode *vp,
|
|
|
|
mode_t access_desired) );
|
2007-01-05 17:36:55 +01:00
|
|
|
_PROTOTYPE( int read_only, (struct vnode *vp) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* read.c */
|
|
|
|
_PROTOTYPE( int do_read, (void) );
|
2006-11-09 17:22:54 +01:00
|
|
|
_PROTOTYPE( int do_getdents, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int read_write, (int rw_flag) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int rw_pipe, (int rw_flag, endpoint_t usr,
|
|
|
|
int fd_nr, struct filp *f, char *buf, size_t req_size) );
|
2006-10-25 15:40:36 +02:00
|
|
|
|
|
|
|
/* request.c */
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_breadwrite, (endpoint_t fs_e, endpoint_t user_e,
|
2010-04-13 12:58:41 +02:00
|
|
|
dev_t dev, u64_t pos, unsigned int num_of_bytes,
|
2007-08-07 14:52:47 +02:00
|
|
|
char *user_addr, int rw_flag,
|
|
|
|
u64_t *new_posp, unsigned int *cum_iop) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int req_chmod, (int fs_e, ino_t inode_nr, mode_t rmode,
|
2007-08-07 14:52:47 +02:00
|
|
|
mode_t *new_modep) );
|
|
|
|
_PROTOTYPE( int req_chown, (endpoint_t fs_e, ino_t inode_nr,
|
2010-04-13 12:58:41 +02:00
|
|
|
uid_t newuid, gid_t newgid, mode_t *new_modep) );
|
2007-01-05 17:36:55 +01:00
|
|
|
_PROTOTYPE( int req_create, (int fs_e, ino_t inode_nr, int omode,
|
2010-04-13 12:58:41 +02:00
|
|
|
uid_t uid, gid_t gid, char *path, node_details_t *res) );
|
|
|
|
_PROTOTYPE( int req_flush, (endpoint_t fs_e, dev_t dev) );
|
2007-08-17 13:20:59 +02:00
|
|
|
_PROTOTYPE( int req_fstatfs, (int fs_e, int who_e, char *buf) );
|
2010-06-24 01:53:50 +02:00
|
|
|
_PROTOTYPE( int req_statvfs, (int fs_e, int who_e, char *buf) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_ftrunc, (endpoint_t fs_e, ino_t inode_nr,
|
|
|
|
off_t start, off_t end) );
|
2010-08-30 15:44:07 +02:00
|
|
|
_PROTOTYPE( int req_getdents, (endpoint_t fs_e, ino_t inode_nr,
|
|
|
|
u64_t pos, char *buf, size_t size,
|
|
|
|
u64_t *new_pos, int direct) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_inhibread, (endpoint_t fs_e, ino_t inode_nr) );
|
|
|
|
_PROTOTYPE( int req_link, (endpoint_t fs_e, ino_t link_parent,
|
|
|
|
char *lastc, ino_t linked_file) );
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
_PROTOTYPE( int req_lookup, (endpoint_t fs_e, ino_t dir_ino, ino_t root_ino,
|
2010-04-13 12:58:41 +02:00
|
|
|
uid_t uid, gid_t gid, int flags,
|
2010-08-30 15:44:07 +02:00
|
|
|
lookup_res_t *res, struct fproc *rfp) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_mkdir, (endpoint_t fs_e, ino_t inode_nr,
|
2010-04-13 12:58:41 +02:00
|
|
|
char *lastc, uid_t uid, gid_t gid, mode_t dmode) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_mknod, (endpoint_t fs_e, ino_t inode_nr,
|
2010-04-13 12:58:41 +02:00
|
|
|
char *lastc, uid_t uid, gid_t gid,
|
|
|
|
mode_t dmode, dev_t dev) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_mountpoint, (endpoint_t fs_e, ino_t inode_nr) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int req_newnode, (endpoint_t fs_e, uid_t uid,
|
|
|
|
gid_t gid, mode_t dmode,
|
|
|
|
dev_t dev, struct node_details *res) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_putnode, (int fs_e, ino_t inode_nr, int count) );
|
|
|
|
_PROTOTYPE( int req_rdlink, (endpoint_t fs_e, ino_t inode_nr,
|
2010-08-30 15:44:07 +02:00
|
|
|
endpoint_t who_e, char *buf, size_t len,
|
|
|
|
int direct) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_readsuper, (endpoint_t fs_e, char *driver_name,
|
2010-04-13 12:58:41 +02:00
|
|
|
dev_t dev, int readonly, int isroot,
|
2007-08-07 14:52:47 +02:00
|
|
|
struct node_details *res_nodep) );
|
|
|
|
_PROTOTYPE( int req_readwrite, (endpoint_t fs_e, ino_t inode_nr,
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
u64_t pos, int rw_flag,
|
|
|
|
endpoint_t user_e, char *user_addr,
|
|
|
|
unsigned int num_of_bytes, u64_t *new_posp,
|
|
|
|
unsigned int *cum_iop) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_rename, (endpoint_t fs_e, ino_t old_dir,
|
|
|
|
char *old_name, ino_t new_dir, char *new_name) );
|
|
|
|
_PROTOTYPE( int req_rmdir, (endpoint_t fs_e, ino_t inode_nr,
|
|
|
|
char *lastc) );
|
|
|
|
_PROTOTYPE(int req_slink, (endpoint_t fs_e, ino_t inode_nr, char *lastc,
|
|
|
|
endpoint_t who_e, char *path_addr,
|
2010-04-13 12:58:41 +02:00
|
|
|
unsigned short path_length, uid_t uid, gid_t gid) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_stat, (int fs_e, ino_t inode_nr, int who_e,
|
2011-07-01 21:35:54 +02:00
|
|
|
char *buf, int pos, int stat_version) );
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( int req_sync, (endpoint_t fs_e) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_unlink, (endpoint_t fs_e, ino_t inode_nr,
|
|
|
|
char *lastc) );
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( int req_unmount, (endpoint_t fs_e) );
|
2007-08-07 14:52:47 +02:00
|
|
|
_PROTOTYPE( int req_utime, (endpoint_t fs_e, ino_t inode_nr,
|
|
|
|
time_t actime, time_t modtime) );
|
2010-04-13 12:58:41 +02:00
|
|
|
_PROTOTYPE( int req_newdriver, (endpoint_t fs_e, dev_t dev,
|
2011-11-30 19:05:26 +01:00
|
|
|
char *label) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* stadir.c */
|
|
|
|
_PROTOTYPE( int do_chdir, (void) );
|
2005-06-29 21:28:26 +02:00
|
|
|
_PROTOTYPE( int do_fchdir, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
_PROTOTYPE( int do_chroot, (void) );
|
|
|
|
_PROTOTYPE( int do_fstat, (void) );
|
|
|
|
_PROTOTYPE( int do_stat, (void) );
|
|
|
|
_PROTOTYPE( int do_fstatfs, (void) );
|
2010-06-24 01:53:50 +02:00
|
|
|
_PROTOTYPE( int do_statvfs, (void) );
|
|
|
|
_PROTOTYPE( int do_fstatvfs, (void) );
|
2005-12-20 15:23:44 +01:00
|
|
|
_PROTOTYPE( int do_rdlink, (void) );
|
|
|
|
_PROTOTYPE( int do_lstat, (void) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
|
|
|
/* time.c */
|
|
|
|
_PROTOTYPE( int do_utime, (void) );
|
2005-05-31 11:50:51 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* utility.c */
|
|
|
|
_PROTOTYPE( time_t clock_time, (void) );
|
|
|
|
_PROTOTYPE( unsigned conv2, (int norm, int w) );
|
|
|
|
_PROTOTYPE( long conv4, (int norm, long x) );
|
|
|
|
_PROTOTYPE( int fetch_name, (char *path, int len, int flag) );
|
|
|
|
_PROTOTYPE( int no_sys, (void) );
|
2010-06-08 16:09:18 +02:00
|
|
|
_PROTOTYPE( int isokendpt_f, (char *f, int l, endpoint_t e, int *p, int ft));
|
2010-08-30 15:44:07 +02:00
|
|
|
_PROTOTYPE( int in_group, (struct fproc *rfp, gid_t grp) );
|
2005-04-21 16:53:53 +02:00
|
|
|
|
endpoint-aware conversion of servers.
'who', indicating caller number in pm and fs and some other servers, has
been removed in favour of 'who_e' (endpoint) and 'who_p' (proc nr.).
In both PM and FS, isokendpt() convert endpoints to process slot
numbers, returning OK if it was a valid and consistent endpoint number.
okendpt() does the same but panic()s if it doesn't succeed. (In PM,
this is pm_isok..)
pm and fs keep their own records of process endpoints in their proc tables,
which are needed to make kernel calls about those processes.
message field names have changed.
fs drivers are endpoints.
fs now doesn't try to get out of driver deadlock, as the protocol isn't
supposed to let that happen any more. (A warning is printed if ELOCKED
is detected though.)
fproc[].fp_task (indicating which driver the process is suspended on)
became an int.
PM and FS now get endpoint numbers of initial boot processes from the
kernel. These happen to be the same as the old proc numbers, to let
user processes reach them with the old numbers, but FS and PM don't know
that. All new processes after INIT, even after the generation number
wraps around, get endpoint numbers with generation 1 and higher, so
the first instances of the boot processes are the only processes ever
to have endpoint numbers in the old proc number range.
More return code checks of sys_* functions have been added.
IS has become endpoint-aware. Ditched the 'text' and 'data' fields
in the kernel dump (which show locations, not sizes, so aren't terribly
useful) in favour of the endpoint number. Proc number is still visible.
Some other dumps (e.g. dmap, rs) show endpoint numbers now too which got
the formatting changed.
PM reading segments using rw_seg() has changed - it uses other fields
in the message now instead of encoding the segment and process number and
fd in the fd field. For that it uses _read_pm() and _write_pm() which to
_taskcall()s directly in pm/misc.c.
PM now sys_exit()s itself on panic(), instead of sys_abort().
RS also talks in endpoints instead of process numbers.
2006-03-03 11:20:58 +01:00
|
|
|
#define okendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 1)
|
|
|
|
#define isokendpt(e, p) isokendpt_f(__FILE__, __LINE__, (e), (p), 0)
|
|
|
|
|
2006-10-25 15:40:36 +02:00
|
|
|
/* vmnt.c */
|
|
|
|
_PROTOTYPE( struct vmnt *get_free_vmnt, (short *index) );
|
|
|
|
_PROTOTYPE( struct vmnt *find_vmnt, (int fs_e) );
|
|
|
|
|
|
|
|
/* vnode.c */
|
- Introduce support for sticky bit.
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly.
- Clean up MFS by removing old, dead code (backwards compatibility is broken by
the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all
functions have proper banners and prototypes.
- VFS should always provide a (syntactically) valid path to the FS; no need for
the FS to do sanity checks when leaving/entering mount points.
- Fix several bugs in MFS:
- Several path lookup bugs in MFS.
- A link can be too big for the path buffer.
- A mountpoint can become inaccessible when the creation of a new inode
fails, because the inode already exists and is a mountpoint.
- Introduce support for supplemental groups.
- Add test 46 to test supplemental group functionality (and removed obsolete
suppl. tests from test 2).
- Clean up VFS (not everything is done yet).
- ISOFS now opens device read-only. This makes the -r flag in the mount command
unnecessary (but will still report to be mounted read-write).
- Introduce PipeFS. PipeFS is a new FS that handles all anonymous and
named pipes. However, named pipes still reside on the (M)FS, as they are part
of the file system on disk. To make this work VFS now has a concept of
'mapped' inodes, which causes read, write, truncate and stat requests to be
redirected to the mapped FS, and all other requests to the original FS.
2009-12-20 21:27:14 +01:00
|
|
|
_PROTOTYPE( struct vnode *get_free_vnode, (void) );
|
2006-10-25 15:40:36 +02:00
|
|
|
_PROTOTYPE( struct vnode *find_vnode, (int fs_e, int numb) );
|
|
|
|
_PROTOTYPE( void dup_vnode, (struct vnode *vp) );
|
|
|
|
_PROTOTYPE( void put_vnode, (struct vnode *vp) );
|
2007-01-05 17:36:55 +01:00
|
|
|
_PROTOTYPE( void vnode_clean_refs, (struct vnode *vp) );
|
2009-05-08 15:56:41 +02:00
|
|
|
#if DO_SANITYCHECKS
|
2009-01-20 14:43:00 +01:00
|
|
|
_PROTOTYPE( int check_vrefs, (void) );
|
2009-05-08 15:56:41 +02:00
|
|
|
#endif
|
2006-10-25 15:40:36 +02:00
|
|
|
|
2005-04-21 16:53:53 +02:00
|
|
|
/* write.c */
|
|
|
|
_PROTOTYPE( int do_write, (void) );
|
2005-06-06 13:40:32 +02:00
|
|
|
|
2010-08-25 15:06:43 +02:00
|
|
|
/* gcov.c */
|
|
|
|
_PROTOTYPE( int do_gcov_flush, (void) );
|
2011-08-09 10:39:33 +02:00
|
|
|
#if ! USE_COVERAGE
|
|
|
|
#define do_gcov_flush no_sys
|
|
|
|
#endif
|
2010-08-25 15:06:43 +02:00
|
|
|
|
2005-06-06 13:40:32 +02:00
|
|
|
/* select.c */
|
|
|
|
_PROTOTYPE( int do_select, (void) );
|
2005-07-22 20:28:32 +02:00
|
|
|
_PROTOTYPE( void init_select, (void) );
|
2011-04-13 15:25:34 +02:00
|
|
|
_PROTOTYPE( void select_callback, (struct filp *, int ops) );
|
|
|
|
_PROTOTYPE( void select_forget, (endpoint_t proc_e) );
|
|
|
|
_PROTOTYPE( void select_reply1, (endpoint_t driver_e, int minor, int status));
|
|
|
|
_PROTOTYPE( void select_reply2, (endpoint_t driver_e, int minor, int status));
|
|
|
|
_PROTOTYPE( void select_timeout_check, (timer_t *) );
|
2009-09-22 23:48:26 +02:00
|
|
|
_PROTOTYPE( void select_unsuspend_by_endpt, (endpoint_t proc) );
|
2011-07-30 08:03:23 +02:00
|
|
|
|
|
|
|
/* elf_core_dump.c */
|
|
|
|
_PROTOTYPE( void write_elf_core_file, (int csig, char *exe_name) );
|