}
/* ld.so is linked at 0, but it can relocate itself; we
- * want it higher to trap NULL pointer dereferences.
+ * want it higher to trap NULL pointer dereferences.
* Let's put it below the stack, and reserve 10MB for ld.so.
*/
execi.args.load_offset =
return ENOEXEC;
}
- /* Find first Aux vector in the stack frame. */
+ /* Find first Aux vector in the stack frame. */
vap = (vir_bytes)(psp->ps_envstr + (psp->ps_nenvstr + 1));
aux_vec = (AuxInfo *) (frame + (vap - *vsp));
aux_vec_end = aux_vec + PMEF_AUXVECTORS;
- if (((char *)aux_vec < frame) ||
+ if (((char *)aux_vec < frame) ||
((char *)aux_vec > (frame + *frame_size))) {
printf("VFS: malformed stack for exec(), first AuxVector is"
" not on the stack.\n");
/*===========================================================================*
* get_filp *
*===========================================================================*/
-struct filp *get_filp(fild, locktype)
-int fild; /* file descriptor */
-tll_access_t locktype;
+struct filp *
+get_filp(
+ int fild, /* file descriptor */
+ tll_access_t locktype
+)
{
/* See if 'fild' refers to a valid file descr. If so, return its filp ptr. */
/*===========================================================================*
* get_filp2 *
*===========================================================================*/
-struct filp *get_filp2(rfp, fild, locktype)
-register struct fproc *rfp;
-int fild; /* file descriptor */
-tll_access_t locktype;
+struct filp *
+get_filp2(
+ register struct fproc *rfp,
+ int fild, /* file descriptor */
+ tll_access_t locktype
+)
{
/* See if 'fild' refers to a valid file descr. If so, return its filp ptr. */
struct filp *filp;
/*===========================================================================*
* lock_filp *
*===========================================================================*/
-void lock_filp(filp, locktype)
-struct filp *filp;
-tll_access_t locktype;
+void
+lock_filp(struct filp *filp, tll_access_t locktype)
{
struct worker_thread *org_self;
struct vnode *vp;
/*===========================================================================*
* unlock_filp *
*===========================================================================*/
-void unlock_filp(filp)
-struct filp *filp;
+void
+unlock_filp(struct filp *filp)
{
/* If this filp holds a soft lock on the vnode, we must be the owner */
if (filp->filp_softlock != NULL)
/*===========================================================================*
* unlock_filps *
*===========================================================================*/
-void unlock_filps(filp1, filp2)
-struct filp *filp1;
-struct filp *filp2;
+void
+unlock_filps(struct filp *filp1, struct filp *filp2)
{
/* Unlock two filps that are tied to the same vnode. As a thread can lock a
* vnode only once, unlocking the vnode twice would result in an error. */
/*===========================================================================*
* close_filp *
*===========================================================================*/
-void close_filp(f)
-struct filp *f;
+void
+close_filp(struct filp *f)
{
/* Close a file. Will also unlock filp when done */
/*===========================================================================*
* truncate_vnode *
*===========================================================================*/
-int truncate_vnode(vp, newsize)
-struct vnode *vp;
-off_t newsize;
+int
+truncate_vnode(struct vnode *vp, off_t newsize)
{
/* Truncate a regular file or a pipe */
int r;
/*===========================================================================*
* rdlink_direct *
*===========================================================================*/
-int rdlink_direct(orig_path, link_path, rfp)
-char *orig_path;
-char link_path[PATH_MAX]; /* should have length PATH_MAX */
-struct fproc *rfp;
+int
+rdlink_direct(
+ char *orig_path,
+ char link_path[PATH_MAX], /* should have length PATH_MAX */
+ struct fproc *rfp
+)
{
/* Perform a readlink()-like call from within the VFS */
int r;
/*===========================================================================*
* lock_revive *
*===========================================================================*/
-void lock_revive()
+void
+lock_revive(void)
{
/* Go find all the processes that are waiting for any kind of lock and
* revive them all. The ones that are still blocked will block again when
/*===========================================================================*
* unblock *
*===========================================================================*/
-static int unblock(rfp)
-struct fproc *rfp;
+static int
+unblock(struct fproc *rfp)
{
/* Unblock a process that was previously blocked on a pipe or a lock. This is
* done by reconstructing the original request and continuing/repeating it.
/*===========================================================================*
* pm_reboot *
*===========================================================================*/
-void pm_reboot()
+void
+pm_reboot(void)
{
/* Perform the VFS side of the reboot call. This call is performed from the PM
* process context.
/*===========================================================================*
* pm_setgid *
*===========================================================================*/
-void pm_setgid(proc_e, egid, rgid)
-endpoint_t proc_e;
-int egid;
-int rgid;
+void
+pm_setgid(endpoint_t proc_e, int egid, int rgid)
{
register struct fproc *tfp;
int slot;
/*===========================================================================*
* pm_setgroups *
*===========================================================================*/
-void pm_setgroups(proc_e, ngroups, groups)
-endpoint_t proc_e;
-int ngroups;
-gid_t *groups;
+void
+pm_setgroups(endpoint_t proc_e, int ngroups, gid_t *groups)
{
struct fproc *rfp;
int slot;
/*===========================================================================*
* pm_setuid *
*===========================================================================*/
-void pm_setuid(proc_e, euid, ruid)
-endpoint_t proc_e;
-int euid;
-int ruid;
+void
+pm_setuid(endpoint_t proc_e, int euid, int ruid)
{
struct fproc *tfp;
int slot;
}
/* A function to be called on panic(). */
-void panic_hook(void)
-{
+void panic_hook(void)
+{
printf("VFS mthread stacktraces:\n");
- mthread_stacktraces();
-}
+ mthread_stacktraces();
+}
/*===========================================================================*
* do_getrusage *
/*===========================================================================*
* close_fd *
*===========================================================================*/
-int close_fd(rfp, fd_nr)
-struct fproc *rfp;
-int fd_nr;
+int
+close_fd(struct fproc *rfp, int fd_nr)
{
/* Perform the close(fd) system call. */
register struct filp *rfilp;
/*===========================================================================*
* advance *
*===========================================================================*/
-struct vnode *advance(dirp, resolve, rfp)
-struct vnode *dirp;
-struct lookup *resolve;
-struct fproc *rfp;
+struct vnode *
+advance(struct vnode *dirp, struct lookup *resolve, struct fproc *rfp)
{
/* Resolve a path name starting at dirp to a vnode. */
int r;
/*===========================================================================*
* eat_path *
*===========================================================================*/
-struct vnode *eat_path(resolve, rfp)
-struct lookup *resolve;
-struct fproc *rfp;
+struct vnode *
+eat_path(struct lookup *resolve, struct fproc *rfp)
{
/* Resolve path to a vnode. advance does the actual work. */
struct vnode *start_dir;
/*===========================================================================*
* last_dir *
*===========================================================================*/
-struct vnode *last_dir(resolve, rfp)
-struct lookup *resolve;
-struct fproc *rfp;
+struct vnode *
+last_dir(struct lookup *resolve, struct fproc *rfp)
{
/* Parse a path, as far as the last directory, fetch the vnode
* for the last directory into the vnode table, and return a pointer to the
/*===========================================================================*
* lookup *
*===========================================================================*/
-static int lookup(start_node, resolve, result_node, rfp)
-struct vnode *start_node;
-struct lookup *resolve;
-node_details_t *result_node;
-struct fproc *rfp;
+static int
+lookup(struct vnode *start_node, struct lookup *resolve, node_details_t *result_node, struct fproc *rfp)
{
/* Resolve a path name relative to start_node. */
/*===========================================================================*
* lookup_init *
*===========================================================================*/
-void lookup_init(resolve, path, flags, vmp, vp)
-struct lookup *resolve;
-char *path;
-int flags;
-struct vmnt **vmp;
-struct vnode **vp;
+void
+lookup_init(struct lookup *resolve, char *path, int flags, struct vmnt **vmp, struct vnode **vp)
{
assert(vmp != NULL);
assert(vp != NULL);
/*===========================================================================*
* get_name *
*===========================================================================*/
-int get_name(dirp, entry, ename)
-struct vnode *dirp;
-struct vnode *entry;
-char ename[NAME_MAX + 1];
+int
+get_name(struct vnode *dirp, struct vnode *entry, char ename[NAME_MAX + 1])
{
#define DIR_ENTRIES 8
#define DIR_ENTRY_SIZE (sizeof(struct dirent) + NAME_MAX)
/*===========================================================================*
* canonical_path *
*===========================================================================*/
-int canonical_path(orig_path, rfp)
-char orig_path[PATH_MAX];
-struct fproc *rfp;
+int
+canonical_path(char orig_path[PATH_MAX], struct fproc *rfp)
{
/* Find canonical path of a given path */
int len = 0;
/*===========================================================================*
* map_vnode *
*===========================================================================*/
-int map_vnode(vp, map_to_fs_e)
-struct vnode *vp;
-endpoint_t map_to_fs_e;
+int
+map_vnode(struct vnode *vp, endpoint_t map_to_fs_e)
{
int r;
struct vmnt *vmp;
/*===========================================================================*
* read_only *
*===========================================================================*/
-int read_only(vp)
-struct vnode *vp; /* ptr to inode whose file sys is to be cked */
+int
+read_only(
+ struct vnode *vp /* ptr to inode whose file sys is to be cked */
+)
{
/* Check to see if the file system on which the inode 'ip' resides is mounted
* read only. If so, return EROFS, else return OK.
/*===========================================================================*
* req_putnode *
*===========================================================================*/
-int req_putnode(fs_e, inode_nr, count)
-int fs_e;
-ino_t inode_nr;
-int count;
+int
+req_putnode(int fs_e, ino_t inode_nr, int count)
{
message m;
/*===========================================================================*
* req_rename *
*===========================================================================*/
-int req_rename(fs_e, old_dir, old_name, new_dir, new_name)
-endpoint_t fs_e;
-ino_t old_dir;
-char *old_name;
-ino_t new_dir;
-char *new_name;
+int
+req_rename(endpoint_t fs_e, ino_t old_dir, char *old_name, ino_t new_dir, char *new_name)
{
int r;
cp_grant_id_t gid_old, gid_new;
/*===========================================================================*
* req_rmdir *
*===========================================================================*/
-int req_rmdir(fs_e, inode_nr, lastc)
-endpoint_t fs_e;
-ino_t inode_nr;
-char *lastc;
+int
+req_rmdir(endpoint_t fs_e, ino_t inode_nr, char *lastc)
{
int r;
cp_grant_id_t grant_id;
/*===========================================================================*
* req_sync *
*===========================================================================*/
-int req_sync(fs_e)
-endpoint_t fs_e;
+int
+req_sync(endpoint_t fs_e)
{
message m;
/*===========================================================================*
* req_unlink *
*===========================================================================*/
-int req_unlink(fs_e, inode_nr, lastc)
-endpoint_t fs_e;
-ino_t inode_nr;
-char *lastc;
+int
+req_unlink(endpoint_t fs_e, ino_t inode_nr, char *lastc)
{
cp_grant_id_t grant_id;
size_t len;
/*===========================================================================*
* req_unmount *
*===========================================================================*/
-int req_unmount(fs_e)
-endpoint_t fs_e;
+int
+req_unmount(endpoint_t fs_e)
{
message m;
src_fds = (direction == FROM_PROC) ? se->vir_readfds : &se->ready_readfds;
dst_fds = (direction == FROM_PROC) ? &se->readfds : se->vir_readfds;
if (se->vir_readfds) {
- r = sys_datacopy_wrapper(src_e, (vir_bytes) src_fds, dst_e,
+ r = sys_datacopy_wrapper(src_e, (vir_bytes) src_fds, dst_e,
(vir_bytes) dst_fds, fd_setsize);
if (r != OK) return(r);
}
src_fds = (direction == FROM_PROC) ? se->vir_writefds : &se->ready_writefds;
dst_fds = (direction == FROM_PROC) ? &se->writefds : se->vir_writefds;
if (se->vir_writefds) {
- r = sys_datacopy_wrapper(src_e, (vir_bytes) src_fds, dst_e,
+ r = sys_datacopy_wrapper(src_e, (vir_bytes) src_fds, dst_e,
(vir_bytes) dst_fds, fd_setsize);
if (r != OK) return(r);
}
src_fds = (direction == FROM_PROC) ? se->vir_errorfds : &se->ready_errorfds;
dst_fds = (direction == FROM_PROC) ? &se->errorfds : se->vir_errorfds;
if (se->vir_errorfds) {
- r = sys_datacopy_wrapper(src_e, (vir_bytes) src_fds, dst_e,
+ r = sys_datacopy_wrapper(src_e, (vir_bytes) src_fds, dst_e,
(vir_bytes) dst_fds, fd_setsize);
if (r != OK) return(r);
}
/*===========================================================================*
* filp_status *
*===========================================================================*/
-static void filp_status(f, status)
-struct filp *f;
-int status;
+static void
+filp_status(struct filp *f, int status)
{
/* Tell processes that need to know about the status of this filp. This
* function MUST NOT block its calling thread.
/*===========================================================================*
* restart_proc *
*===========================================================================*/
-static void restart_proc(se)
-struct selectentry *se;
+static void
+restart_proc(struct selectentry *se)
{
/* Tell process about select results (if any) unless there are still results
* pending. This function MUST NOT block its calling thread.
/*===========================================================================*
* check_vmnt_locks *
*===========================================================================*/
-void check_vmnt_locks()
+void
+check_vmnt_locks(void)
{
struct vmnt *vmp;
int count = 0;
/*===========================================================================*
* check_vnode_locks *
*===========================================================================*/
-void check_vnode_locks()
+void
+check_vnode_locks(void)
{
struct vnode *vp;
int count = 0;
/*===========================================================================*
* get_free_vnode *
*===========================================================================*/
-struct vnode *get_free_vnode()
+struct vnode *
+get_free_vnode(void)
{
/* Find a free vnode slot in the vnode table (it's not actually allocated) */
struct vnode *vp;