From: David van Moolenbroek Date: Tue, 29 Oct 2013 22:15:15 +0000 (+0100) Subject: VFS: store m_out as part of worker thread state X-Git-Tag: v3.3.0~518 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-dsfromkey.html?a=commitdiff_plain;h=2c8310fce6f3e1a73c3bd08fa3ccb9cee74d85d4;p=minix.git VFS: store m_out as part of worker thread state There is no need to pass pointers around when there is a structure available that already stores other similar state, such as m_in. Change-Id: I3164c5c55c71f443688103d1f0756c086eb05974 --- diff --git a/servers/vfs/device.c b/servers/vfs/device.c index 4785314a1..dc07a3e3f 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -476,7 +476,7 @@ int cdev_close(dev_t dev) /*===========================================================================* * do_ioctl * *===========================================================================*/ -int do_ioctl(message *UNUSED(m_out)) +int do_ioctl(void) { /* Perform the ioctl(ls_fd, request, argx) system call */ unsigned long ioctlrequest; diff --git a/servers/vfs/dmap.c b/servers/vfs/dmap.c index 02f4c22ac..9be6d7b3b 100644 --- a/servers/vfs/dmap.c +++ b/servers/vfs/dmap.c @@ -106,7 +106,7 @@ endpoint_t proc_nr_e; /* process number of the driver */ /*===========================================================================* * do_mapdriver * *===========================================================================*/ -int do_mapdriver(message *UNUSED(m_out)) +int do_mapdriver(void) { /* Create a device->driver mapping. RS will tell us which major is driven by * this driver, what type of device it is (regular, TTY, asynchronous, clone, diff --git a/servers/vfs/filedes.c b/servers/vfs/filedes.c index 12801bbde..d027bdd44 100644 --- a/servers/vfs/filedes.c +++ b/servers/vfs/filedes.c @@ -414,7 +414,7 @@ struct filp *f; /*===========================================================================* * do_copyfd * *===========================================================================*/ -int do_copyfd(message *UNUSED(m_out)) +int do_copyfd(void) { /* Copy a file descriptor between processes, or close a remote file descriptor. * This call is used as back-call by device drivers (UDS, VND), and is expected diff --git a/servers/vfs/glo.h b/servers/vfs/glo.h index 09009c450..50a4bf259 100644 --- a/servers/vfs/glo.h +++ b/servers/vfs/glo.h @@ -28,7 +28,8 @@ EXTERN message m_in; /* the input message itself */ # define fproc_addr(e) (&fproc[_ENDPOINT_P(e)]) # define who_e (self != NULL ? fp->fp_endpoint : m_in.m_source) # define call_nr (m_in.m_type) -# define job_m_in (self->w_msg) +# define job_m_in (self->w_m_in) +# define job_m_out (self->w_m_out) # define job_call_nr (job_m_in.m_type) # define super_user (fp->fp_effuid == SU_UID ? 1 : 0) # define scratch(p) (scratchpad[((int) ((p) - fproc))]) @@ -42,8 +43,7 @@ EXTERN char mount_label[LABEL_MAX]; /* label of file system to mount */ EXTERN int err_code; /* temporary storage for error number */ /* Data initialized elsewhere. */ -extern int(*call_vec[]) (message *); -extern int(*pfs_call_vec[]) (message *m_out); +extern int (*call_vec[])(void); EXTERN struct kinfo kinfo; /* kernel information */ diff --git a/servers/vfs/link.c b/servers/vfs/link.c index 0c7779f0f..a1ba296f8 100644 --- a/servers/vfs/link.c +++ b/servers/vfs/link.c @@ -28,7 +28,7 @@ /*===========================================================================* * do_link * *===========================================================================*/ -int do_link(message *UNUSED(m_out)) +int do_link(void) { /* Perform the link(name1, name2) system call. */ int r = OK; @@ -90,7 +90,7 @@ int do_link(message *UNUSED(m_out)) /*===========================================================================* * do_unlink * *===========================================================================*/ -int do_unlink(message *UNUSED(m_out)) +int do_unlink(void) { /* Perform the unlink(name) or rmdir(name) system call. The code for these two * is almost the same. They differ only in some condition testing. Unlink() @@ -175,7 +175,7 @@ int do_unlink(message *UNUSED(m_out)) /*===========================================================================* * do_rename * *===========================================================================*/ -int do_rename(message *UNUSED(m_out)) +int do_rename(void) { /* Perform the rename(name1, name2) system call. */ int r = OK, r1; @@ -282,7 +282,7 @@ int do_rename(message *UNUSED(m_out)) /*===========================================================================* * do_truncate * *===========================================================================*/ -int do_truncate(message *UNUSED(m_out)) +int do_truncate(void) { /* truncate_vnode() does the actual work of do_truncate() and do_ftruncate(). * do_truncate() and do_ftruncate() have to get hold of the inode, either @@ -333,7 +333,7 @@ int do_truncate(message *UNUSED(m_out)) /*===========================================================================* * do_ftruncate * *===========================================================================*/ -int do_ftruncate(message *UNUSED(m_out)) +int do_ftruncate(void) { /* As with do_truncate(), truncate_vnode() does the actual work. */ struct filp *rfilp; @@ -394,7 +394,7 @@ off_t newsize; /*===========================================================================* * do_slink * *===========================================================================*/ -int do_slink(message *UNUSED(m_out)) +int do_slink(void) { /* Perform the symlink(name1, name2) system call. */ int r; @@ -476,7 +476,7 @@ struct fproc *rfp; /*===========================================================================* * do_rdlink * *===========================================================================*/ -int do_rdlink(message *UNUSED(m_out)) +int do_rdlink(void) { /* Perform the readlink(name, buf, bufsize) system call. */ int r; diff --git a/servers/vfs/main.c b/servers/vfs/main.c index 4c18a3276..68eb02a37 100644 --- a/servers/vfs/main.c +++ b/servers/vfs/main.c @@ -40,6 +40,7 @@ static void do_fs_reply(struct worker_thread *wp); static void do_work(void); static void do_init_root(void); static void handle_work(void (*func)(void)); +static void reply(message *m_out, endpoint_t whom, int result); static void get_work(void); static void service_pm(void); @@ -229,9 +230,8 @@ static void do_pending_pipe(void) static void do_work(void) { int error; - message m_out; - memset(&m_out, 0, sizeof(m_out)); + memset(&job_m_out, 0, sizeof(job_m_out)); /* At this point we assume that we're dealing with a call that has been * made specifically to VFS. Typically it will be a POSIX call from a @@ -249,11 +249,11 @@ static void do_work(void) #if ENABLE_SYSCALL_STATS calls_stats[job_call_nr]++; #endif - error = (*call_vec[job_call_nr])(&m_out); + error = (*call_vec[job_call_nr])(); } /* Copy the results back to the user and send reply. */ - if (error != SUSPEND) reply(&m_out, fp->fp_endpoint, error); + if (error != SUSPEND) reply(&job_m_out, fp->fp_endpoint, error); } /*===========================================================================* @@ -520,7 +520,7 @@ static void get_work() /*===========================================================================* * reply * *===========================================================================*/ -void reply(message *m_out, endpoint_t whom, int result) +static void reply(message *m_out, endpoint_t whom, int result) { /* Send a reply to a user process. If the send fails, just ignore it. */ int r; @@ -540,18 +540,11 @@ void reply(message *m_out, endpoint_t whom, int result) void replycode(endpoint_t whom, int result) { /* Send a reply to a user process. If the send fails, just ignore it. */ - int r; message m_out; memset(&m_out, 0, sizeof(m_out)); - m_out.reply_type = result; - r = sendnb(whom, &m_out); - if (r != OK) { - printf("VFS: %d couldn't send reply %d to %d: %d\n", mthread_self(), - result, whom, r); - util_stacktrace(); - } + reply(&m_out, whom, result); } /*===========================================================================* diff --git a/servers/vfs/misc.c b/servers/vfs/misc.c index 57ecaf6e2..9c32460ef 100644 --- a/servers/vfs/misc.c +++ b/servers/vfs/misc.c @@ -51,7 +51,7 @@ static void free_proc(int flags); /*===========================================================================* * do_getsysinfo * *===========================================================================*/ -int do_getsysinfo(message *UNUSED(m_out)) +int do_getsysinfo(void) { vir_bytes src_addr, dst_addr; size_t len, buf_size; @@ -96,7 +96,7 @@ int do_getsysinfo(message *UNUSED(m_out)) /*===========================================================================* * do_fcntl * *===========================================================================*/ -int do_fcntl(message *UNUSED(m_out)) +int do_fcntl(void) { /* Perform the fcntl(fd, request, ...) system call. */ @@ -232,8 +232,10 @@ int do_fcntl(message *UNUSED(m_out)) return(r); } -static int -sync_fses(void) +/*===========================================================================* + * do_sync * + *===========================================================================*/ +int do_sync(void) { struct vmnt *vmp; int r = OK; @@ -251,18 +253,10 @@ sync_fses(void) return(r); } -/*===========================================================================* - * do_sync * - *===========================================================================*/ -int do_sync(message *UNUSED(m_out)) -{ - return sync_fses(); -} - /*===========================================================================* * do_fsync * *===========================================================================*/ -int do_fsync(message *UNUSED(m_out)) +int do_fsync(void) { /* Perform the fsync() system call. */ struct filp *rfilp; @@ -345,7 +339,7 @@ int dupvm(struct fproc *rfp, int pfd, int *vmfd, struct filp **newfilp) /*===========================================================================* * do_vm_call * *===========================================================================*/ -int do_vm_call(message *m_out) +int do_vm_call(void) { /* A call that VM does to VFS. * We must reply with the fixed type VM_VFS_REPLY (and put our result info @@ -397,18 +391,18 @@ int do_vm_call(message *m_out) if(S_ISBLK(f->filp_vno->v_mode)) { assert(f->filp_vno->v_sdev != NO_DEV); - m_out->VMV_DEV = f->filp_vno->v_sdev; - m_out->VMV_INO = VMC_NO_INODE; - m_out->VMV_SIZE_PAGES = LONG_MAX; + job_m_out.VMV_DEV = f->filp_vno->v_sdev; + job_m_out.VMV_INO = VMC_NO_INODE; + job_m_out.VMV_SIZE_PAGES = LONG_MAX; } else { - m_out->VMV_DEV = f->filp_vno->v_dev; - m_out->VMV_INO = f->filp_vno->v_inode_nr; - m_out->VMV_SIZE_PAGES = + job_m_out.VMV_DEV = f->filp_vno->v_dev; + job_m_out.VMV_INO = f->filp_vno->v_inode_nr; + job_m_out.VMV_SIZE_PAGES = roundup(f->filp_vno->v_size, PAGE_SIZE)/PAGE_SIZE; } - m_out->VMV_FD = procfd; + job_m_out.VMV_FD = procfd; result = OK; @@ -425,10 +419,8 @@ int do_vm_call(message *m_out) } case VMVFSREQ_FDIO: { - message dummy_out; - - result = actual_llseek(fp, &dummy_out, req_fd, - SEEK_SET, offset); + result = actual_llseek(fp, req_fd, SEEK_SET, offset, + NULL); if(result == OK) { result = actual_read_write_peek(fp, PEEKING, @@ -448,16 +440,15 @@ reqdone: /* fp is VM still. */ assert(fp == vmf); - m_out->VMV_ENDPOINT = ep; - m_out->VMV_RESULT = result; - m_out->VMV_REQID = req_id; + job_m_out.VMV_ENDPOINT = ep; + job_m_out.VMV_RESULT = result; + job_m_out.VMV_REQID = req_id; /* reply asynchronously as VM may not be able to receive * a sendnb() message */ - - m_out->m_type = VM_VFS_REPLY; - r = asynsend3(VM_PROC_NR, m_out, 0); + job_m_out.m_type = VM_VFS_REPLY; + r = asynsend3(VM_PROC_NR, &job_m_out, 0); if(r != OK) printf("VFS: couldn't asynsend3() to VM\n"); /* VFS does not reply any further */ @@ -478,7 +469,7 @@ void pm_reboot() pmfp = fp; - sync_fses(); + do_sync(); /* Do exit processing for all leftover processes and servers, but don't * actually exit them (if they were really gone, PM will tell us about it). @@ -507,7 +498,7 @@ void pm_reboot() if (rfp != fp) unlock_proc(rfp); } - sync_fses(); + do_sync(); unmount_all(0 /* Don't force */); /* Try to exit all processes again including File Servers */ @@ -525,7 +516,7 @@ void pm_reboot() if (rfp != fp) unlock_proc(rfp); } - sync_fses(); + do_sync(); unmount_all(1 /* Force */); /* Reply to PM for synchronization */ @@ -767,7 +758,7 @@ void pm_setsid(endpoint_t proc_e) /*===========================================================================* * do_svrctl * *===========================================================================*/ -int do_svrctl(message *UNUSED(m_out)) +int do_svrctl(void) { unsigned int svrctl; vir_bytes ptr; @@ -949,7 +940,7 @@ void panic_hook(void) /*===========================================================================* * do_getrusage * *===========================================================================*/ -int do_getrusage(message *UNUSED(m_out)) +int do_getrusage(void) { int res; struct rusage r_usage; diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index ae4ca2e66..60cd61952 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -83,7 +83,7 @@ static void update_bspec(dev_t dev, endpoint_t fs_e, int send_drv_e) /*===========================================================================* * do_fsready * *===========================================================================*/ -int do_fsready(message *UNUSED(m_out)) +int do_fsready(void) { /* deprecated */ return(SUSPEND); @@ -92,7 +92,7 @@ int do_fsready(message *UNUSED(m_out)) /*===========================================================================* * do_mount * *===========================================================================*/ -int do_mount(message *UNUSED(m_out)) +int do_mount(void) { /* Perform the mount(name, mfile, mount_flags) system call. */ endpoint_t fs_e; @@ -425,7 +425,7 @@ void mount_pfs(void) /*===========================================================================* * do_umount * *===========================================================================*/ -int do_umount(message *UNUSED(m_out)) +int do_umount(void) { /* Perform the umount(name) system call. Return the label of the FS service. */ diff --git a/servers/vfs/open.c b/servers/vfs/open.c index 117cf1b1c..907cfb706 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -37,7 +37,7 @@ static int pipe_open(struct vnode *vp, mode_t bits, int oflags); /*===========================================================================* * do_open * *===========================================================================*/ -int do_open(message *UNUSED(m_out)) +int do_open(void) { /* Perform the open(name, flags,...) system call. * syscall might provide 'name' embedded in message when not creating file */ @@ -495,7 +495,7 @@ static int pipe_open(struct vnode *vp, mode_t bits, int oflags) /*===========================================================================* * do_mknod * *===========================================================================*/ -int do_mknod(message *UNUSED(m_out)) +int do_mknod(void) { /* Perform the mknod(name, mode, addr) system call. */ register mode_t bits, mode_bits; @@ -544,7 +544,7 @@ int do_mknod(message *UNUSED(m_out)) /*===========================================================================* * do_mkdir * *===========================================================================*/ -int do_mkdir(message *UNUSED(m_out)) +int do_mkdir(void) { /* Perform the mkdir(name, mode) system call. */ mode_t bits; /* mode bits for the new inode */ @@ -586,8 +586,8 @@ int do_mkdir(message *UNUSED(m_out)) /*===========================================================================* * actual_llseek * *===========================================================================*/ -int actual_llseek(struct fproc *rfp, message *m_out, int seekfd, int seekwhence, - off_t offset) +int actual_llseek(struct fproc *rfp, int seekfd, int seekwhence, off_t offset, + off_t *newposp) { /* Perform the llseek(ls_fd, offset, whence) system call. */ register struct filp *rfilp; @@ -621,9 +621,7 @@ int actual_llseek(struct fproc *rfp, message *m_out, int seekfd, int seekwhence, } else if ((offset < 0) && (newpos >= pos)) { r = EOVERFLOW; } else { - /* insert the new position into the output message */ - m_out->reply_l1 = ex64lo(newpos); - m_out->reply_l2 = ex64hi(newpos); + if (newposp != NULL) *newposp = newpos; if (newpos != rfilp->filp_pos) { rfilp->filp_pos = newpos; @@ -641,16 +639,26 @@ int actual_llseek(struct fproc *rfp, message *m_out, int seekfd, int seekwhence, /*===========================================================================* * do_lseek * *===========================================================================*/ -int do_lseek(message *m_out) +int do_lseek(void) { - return actual_llseek(fp, m_out, job_m_in.ls_fd, job_m_in.whence, - make64(job_m_in.offset_lo, job_m_in.offset_high)); + off_t newpos; + int r; + + if ((r = actual_llseek(fp, job_m_in.ls_fd, job_m_in.whence, + make64(job_m_in.offset_lo, job_m_in.offset_high), + &newpos)) != OK) + return r; + + /* insert the new position into the output message */ + job_m_out.reply_l1 = ex64lo(newpos); + job_m_out.reply_l2 = ex64hi(newpos); + return OK; } /*===========================================================================* * do_close * *===========================================================================*/ -int do_close(message *UNUSED(m_out)) +int do_close(void) { /* Perform the close(fd) system call. */ int thefd = job_m_in.fd; diff --git a/servers/vfs/path.c b/servers/vfs/path.c index 7c6c0183e..99ab8155e 100644 --- a/servers/vfs/path.c +++ b/servers/vfs/path.c @@ -867,7 +867,7 @@ size_t pathlen; /*===========================================================================* * do_checkperms * *===========================================================================*/ -int do_checkperms(message *UNUSED(m_out)) +int do_checkperms(void) { /* This should be replaced by an ACL check. */ if (!super_user) return EPERM; diff --git a/servers/vfs/pipe.c b/servers/vfs/pipe.c index 135891e3b..b3305e947 100644 --- a/servers/vfs/pipe.c +++ b/servers/vfs/pipe.c @@ -38,7 +38,7 @@ static int create_pipe(int fil_des[2], int flags); /*===========================================================================* * do_pipe * *===========================================================================*/ -int do_pipe(message *m_out) +int do_pipe(void) { /* Perform the pipe(fil_des[2]) system call. */ @@ -47,8 +47,8 @@ int do_pipe(message *m_out) r = create_pipe(fil_des, 0 /* no flags */); if (r == OK) { - m_out->reply_i1 = fil_des[0]; - m_out->reply_i2 = fil_des[1]; + job_m_out.reply_i1 = fil_des[0]; + job_m_out.reply_i2 = fil_des[1]; } return r; @@ -57,7 +57,7 @@ int do_pipe(message *m_out) /*===========================================================================* * do_pipe2 * *===========================================================================*/ -int do_pipe2(message *m_out) +int do_pipe2(void) { /* Perform the pipe2(fil_des[2], flags) system call. */ int r, flags; @@ -67,8 +67,8 @@ int do_pipe2(message *m_out) r = create_pipe(fil_des, flags); if (r == OK) { - m_out->reply_i1 = fil_des[0]; - m_out->reply_i2 = fil_des[1]; + job_m_out.reply_i1 = fil_des[0]; + job_m_out.reply_i2 = fil_des[1]; } return r; diff --git a/servers/vfs/protect.c b/servers/vfs/protect.c index d719e3e07..9255fe7bd 100644 --- a/servers/vfs/protect.c +++ b/servers/vfs/protect.c @@ -23,7 +23,7 @@ /*===========================================================================* * do_chmod * *===========================================================================*/ -int do_chmod(message *UNUSED(m_out)) +int do_chmod(void) { /* Perform the chmod(name, mode) and fchmod(fd, mode) system calls. * syscall might provide 'name' embedded in the message. @@ -102,7 +102,7 @@ int do_chmod(message *UNUSED(m_out)) /*===========================================================================* * do_chown * *===========================================================================*/ -int do_chown(message *UNUSED(m_out)) +int do_chown(void) { /* Perform the chown(path, owner, group) and fchmod(fd, owner, group) system * calls. */ @@ -184,7 +184,7 @@ int do_chown(message *UNUSED(m_out)) /*===========================================================================* * do_umask * *===========================================================================*/ -int do_umask(message *UNUSED(m_out)) +int do_umask(void) { /* Perform the umask(co_mode) system call. */ mode_t complement, new_umask; @@ -200,7 +200,7 @@ int do_umask(message *UNUSED(m_out)) /*===========================================================================* * do_access * *===========================================================================*/ -int do_access(message *UNUSED(m_out)) +int do_access(void) { /* Perform the access(name, mode) system call. * syscall might provide 'name' embedded in the message. diff --git a/servers/vfs/proto.h b/servers/vfs/proto.h index 89f8b2c3f..be4862ad9 100644 --- a/servers/vfs/proto.h +++ b/servers/vfs/proto.h @@ -39,12 +39,12 @@ int bdev_open(dev_t dev, int access); int bdev_close(dev_t dev); void bdev_reply(void); void bdev_up(int major); -int do_ioctl(message *m_out); +int do_ioctl(void); /* dmap.c */ void lock_dmap(struct dmap *dp); void unlock_dmap(struct dmap *dp); -int do_mapdriver(message *m_out); +int do_mapdriver(void); void init_dmap(void); int dmap_driver_match(endpoint_t proc, int major); void dmap_endpt_up(endpoint_t proc_nr, int is_blk); @@ -76,17 +76,17 @@ void invalidate_filp(struct filp *); void invalidate_filp_by_endpt(endpoint_t proc_e); void invalidate_filp_by_char_major(int major); void close_filp(struct filp *fp); -int do_copyfd(message *m_out); +int do_copyfd(void); /* fscall.c */ void nested_fs_call(message *m); /* link.c */ -int do_link(message *m_out); -int do_unlink(message *m_out); -int do_rename(message *m_out); -int do_truncate(message *m_out); -int do_ftruncate(message *m_out); +int do_link(void); +int do_unlink(void); +int do_rename(void); +int do_truncate(void); +int do_ftruncate(void); int truncate_vnode(struct vnode *vp, off_t newsize); int rdlink_direct(char *orig_path, char *link_path, struct fproc *rfp); @@ -98,34 +98,33 @@ void lock_revive(void); int main(void); void lock_proc(struct fproc *rfp); void unlock_proc(struct fproc *rfp); -void reply(message *m_out, endpoint_t whom, int result); void replycode(endpoint_t whom, int result); void service_pm_postponed(void); void thread_cleanup(void); /* misc.c */ void pm_exit(void); -int do_fcntl(message *m_out); +int do_fcntl(void); void pm_fork(endpoint_t pproc, endpoint_t cproc, pid_t cpid); void pm_setgid(endpoint_t proc_e, int egid, int rgid); void pm_setuid(endpoint_t proc_e, int euid, int ruid); void pm_setgroups(endpoint_t proc_e, int ngroups, gid_t *addr); void pm_setsid(endpoint_t proc_e); -int do_sync(message *m_out); -int do_fsync(message *m_out); +int do_sync(void); +int do_fsync(void); void pm_reboot(void); -int do_svrctl(message *m_out); -int do_getsysinfo(message *m_out); -int do_vm_call(message *m_out); +int do_svrctl(void); +int do_getsysinfo(void); +int do_vm_call(void); int pm_dumpcore(int sig, vir_bytes exe_name); void ds_event(void); int dupvm(struct fproc *fp, int pfd, int *vmfd, struct filp **f); -int do_getrusage(message *m_out); +int do_getrusage(void); /* mount.c */ -int do_fsready(message *m_out); -int do_mount(message *m_out); -int do_umount(message *m_out); +int do_fsready(void); +int do_mount(void); +int do_umount(void); int is_nonedev(dev_t dev); void mount_pfs(void); int mount_fs(dev_t dev, char mount_dev[PATH_MAX], char mount_path[PATH_MAX], @@ -135,19 +134,17 @@ int unmount(dev_t dev, char label[LABEL_MAX]); void unmount_all(int force); /* open.c */ -int do_close(message *m_out); +int do_close(void); int close_fd(struct fproc *rfp, int fd_nr); int common_open(char path[PATH_MAX], int oflags, mode_t omode); int do_creat(void); -int do_lseek(message *m_out); -int do_mknod(message *m_out); -int do_mkdir(message *m_out); -int do_open(message *m_out); -int do_slink(message *m_out); -int actual_llseek(struct fproc *rfp, message *m_out, int seekfd, - int seekwhence, off_t offset); -int do_vm_open(void); -int do_vm_close(void); +int do_lseek(void); +int do_mknod(void); +int do_mkdir(void); +int do_open(void); +int do_slink(void); +int actual_llseek(struct fproc *rfp, int seekfd, int seekwhence, off_t offset, + off_t *newposp); /* path.c */ struct vnode *advance(struct vnode *dirp, struct lookup *resolve, struct @@ -158,11 +155,11 @@ void lookup_init(struct lookup *resolve, char *path, int flags, struct vmnt **vmp, struct vnode **vp); int get_name(struct vnode *dirp, struct vnode *entry, char *_name); int canonical_path(char *orig_path, struct fproc *rfp); -int do_checkperms(message *m_out); +int do_checkperms(void); /* pipe.c */ -int do_pipe(message *m_out); -int do_pipe2(message *m_out); +int do_pipe(void); +int do_pipe2(void); int map_vnode(struct vnode *vp, endpoint_t fs_e); void unpause(void); int pipe_check(struct filp *filp, int rw_flag, int oflags, int bytes, @@ -175,17 +172,17 @@ void unsuspend_by_endpt(endpoint_t proc_e); void wait_for(endpoint_t proc_e); /* protect.c */ -int do_access(message *m_out); -int do_chmod(message *m_out); -int do_chown(message *m_out); -int do_umask(message *m_out); +int do_access(void); +int do_chmod(void); +int do_chown(void); +int do_umask(void); int forbidden(struct fproc *rfp, struct vnode *vp, mode_t access_desired); int read_only(struct vnode *vp); /* read.c */ -int do_read(message *m_out); -int do_getdents(message *m_out); +int do_read(void); +int do_getdents(void); void lock_bsf(void); void unlock_bsf(void); void check_bsf_lock(void); @@ -249,21 +246,21 @@ int req_utime(endpoint_t fs_e, ino_t inode_nr, struct timespec * actv, int req_newdriver(endpoint_t fs_e, dev_t dev, char *label); /* stadir.c */ -int do_chdir(message *m_out); -int do_fchdir(message *m_out); -int do_chroot(message *m_out); -int do_fstat(message *m_out); -int do_stat(message *m_out); -int do_statvfs(message *m_out); -int do_fstatvfs(message *m_out); -int do_getvfsstat(message *m_out); -int do_rdlink(message *m_out); -int do_lstat(message *m_out); +int do_chdir(void); +int do_fchdir(void); +int do_chroot(void); +int do_fstat(void); +int do_stat(void); +int do_statvfs(void); +int do_fstatvfs(void); +int do_getvfsstat(void); +int do_rdlink(void); +int do_lstat(void); int update_statvfs(struct vmnt *vmp, struct statvfs *buf); /* time.c */ -int do_utime(message *); -int do_utimens(message *); +int do_utime(void); +int do_utimens(void); /* tll.c */ void tll_downgrade(tll_t *tllp); @@ -282,7 +279,7 @@ unsigned conv2(int norm, int w); long conv4(int norm, long x); int copy_name(size_t len, char *dest); int fetch_name(vir_bytes path, size_t len, char *dest); -int no_sys(message *); +int no_sys(void); int isokendpt_f(const char *f, int l, endpoint_t e, int *p, int ft); int in_group(struct fproc *rfp, gid_t grp); @@ -319,7 +316,7 @@ void vnode_clean_refs(struct vnode *vp); void upgrade_vnode_lock(struct vnode *vp); /* write.c */ -int do_write(message *m_out); +int do_write(void); /* gcov.c */ int do_gcov_flush(void); @@ -328,7 +325,7 @@ int do_gcov_flush(void); #endif /* select.c */ -int do_select(message *m_out); +int do_select(void); void init_select(void); void select_callback(struct filp *, int ops); void select_forget(void); diff --git a/servers/vfs/read.c b/servers/vfs/read.c index 2222514bd..c94bf4250 100644 --- a/servers/vfs/read.c +++ b/servers/vfs/read.c @@ -29,7 +29,7 @@ /*===========================================================================* * do_read * *===========================================================================*/ -int do_read(message *UNUSED(m_out)) +int do_read(void) { return(do_read_write_peek(READING, job_m_in.fd, job_m_in.buffer, (size_t) job_m_in.nbytes)); @@ -267,7 +267,7 @@ int read_write(struct fproc *rfp, int rw_flag, struct filp *f, /*===========================================================================* * do_getdents * *===========================================================================*/ -int do_getdents(message *UNUSED(m_out)) +int do_getdents(void) { /* Perform the getdents(fd, buf, size) system call. */ int r = OK; diff --git a/servers/vfs/select.c b/servers/vfs/select.c index ba811d8ab..bb17c737e 100644 --- a/servers/vfs/select.c +++ b/servers/vfs/select.c @@ -80,7 +80,7 @@ static struct fdtype { /*===========================================================================* * do_select * *===========================================================================*/ -int do_select(message *UNUSED(m_out)) +int do_select(void) { /* Implement the select(nfds, readfds, writefds, errorfds, timeout) system * call. First we copy the arguments and verify their sanity. Then we check diff --git a/servers/vfs/stadir.c b/servers/vfs/stadir.c index badcf10f8..3324aa8b5 100644 --- a/servers/vfs/stadir.c +++ b/servers/vfs/stadir.c @@ -30,7 +30,7 @@ static int change_into(struct vnode **iip, struct vnode *vp); /*===========================================================================* * do_fchdir * *===========================================================================*/ -int do_fchdir(message *UNUSED(m_out)) +int do_fchdir(void) { /* Change directory on already-opened fd. */ struct filp *rfilp; @@ -48,7 +48,7 @@ int do_fchdir(message *UNUSED(m_out)) /*===========================================================================* * do_chdir * *===========================================================================*/ -int do_chdir(message *UNUSED(m_out)) +int do_chdir(void) { /* Perform the chdir(name) system call. * syscall might provide 'name' embedded in the message. @@ -89,7 +89,7 @@ int do_chdir(message *UNUSED(m_out)) /*===========================================================================* * do_chroot * *===========================================================================*/ -int do_chroot(message *UNUSED(m_out)) +int do_chroot(void) { /* Perform the chroot(name) system call. * syscall might provide 'name' embedded in the message. @@ -154,7 +154,7 @@ static int change_into(struct vnode **result, struct vnode *vp) /*===========================================================================* * do_stat * *===========================================================================*/ -int do_stat(message *UNUSED(m_out)) +int do_stat(void) { /* Perform the stat(name, buf) system call. */ int r; @@ -187,7 +187,7 @@ int do_stat(message *UNUSED(m_out)) /*===========================================================================* * do_fstat * *===========================================================================*/ -int do_fstat(message *UNUSED(m_out)) +int do_fstat(void) { /* Perform the fstat(fd, buf) system call. */ register struct filp *rfilp; @@ -307,7 +307,7 @@ static int fill_statvfs(struct vmnt *vmp, endpoint_t endpt, vir_bytes buf_addr, /*===========================================================================* * do_statvfs * *===========================================================================*/ -int do_statvfs(message *UNUSED(m_out)) +int do_statvfs(void) { /* Perform the statvfs1(name, buf, flags) system call. */ int r, flags; @@ -341,7 +341,7 @@ int do_statvfs(message *UNUSED(m_out)) /*===========================================================================* * do_fstatvfs * *===========================================================================*/ -int do_fstatvfs(message *UNUSED(m_out)) +int do_fstatvfs(void) { /* Perform the fstatvfs1(fd, buf, flags) system call. */ register struct filp *rfilp; @@ -364,7 +364,7 @@ int do_fstatvfs(message *UNUSED(m_out)) /*===========================================================================* * do_getvfsstat * *===========================================================================*/ -int do_getvfsstat(message *UNUSED(m_out)) +int do_getvfsstat(void) { /* Perform the getvfsstat(buf, bufsize, flags) system call. */ struct vmnt *vmp; @@ -431,7 +431,7 @@ int do_getvfsstat(message *UNUSED(m_out)) /*===========================================================================* * do_lstat * *===========================================================================*/ -int do_lstat(message *UNUSED(m_out)) +int do_lstat(void) { /* Perform the lstat(name, buf) system call. */ struct vnode *vp; diff --git a/servers/vfs/table.c b/servers/vfs/table.c index 1abf53e9b..a1163ea8b 100644 --- a/servers/vfs/table.c +++ b/servers/vfs/table.c @@ -13,7 +13,7 @@ #include "vnode.h" #include "vmnt.h" -int (*call_vec[])(message *m_out) = { +int (*call_vec[])(void) = { no_sys, /* 0 = unused */ no_sys, /* 1 = (exit) */ no_sys, /* 2 = (fork) */ diff --git a/servers/vfs/threads.h b/servers/vfs/threads.h index 93ca0be34..ff2f54b97 100644 --- a/servers/vfs/threads.h +++ b/servers/vfs/threads.h @@ -29,7 +29,8 @@ struct worker_thread { mutex_t w_event_mutex; cond_t w_event; struct fproc *w_fp; - message w_msg; + message w_m_in; + message w_m_out; int w_err_code; message *w_fs_sendrec; message *w_drv_sendrec; diff --git a/servers/vfs/time.c b/servers/vfs/time.c index 4de1cd747..028eab044 100644 --- a/servers/vfs/time.c +++ b/servers/vfs/time.c @@ -25,7 +25,7 @@ /*===========================================================================* * do_utime * *===========================================================================*/ -int do_utime(message *UNUSED(m_out)) +int do_utime(void) { /* Perform the utime(name, timep) system call. */ int r; @@ -83,7 +83,7 @@ int do_utime(message *UNUSED(m_out)) /*===========================================================================* * do_utimens * *===========================================================================*/ -int do_utimens(message *UNUSED(m_out)) +int do_utimens(void) { /* Perform the utimens(name, times, flag) system call, and its friends. * Implement a very large but not complete subset of the utimensat() diff --git a/servers/vfs/utility.c b/servers/vfs/utility.c index 275be2560..0975f5b2c 100644 --- a/servers/vfs/utility.c +++ b/servers/vfs/utility.c @@ -96,7 +96,7 @@ int fetch_name(vir_bytes path, size_t len, char *dest) /*===========================================================================* * no_sys * *===========================================================================*/ -int no_sys(message *UNUSED(m_out)) +int no_sys(void) { /* Somebody has used an illegal system call number */ return(ENOSYS); diff --git a/servers/vfs/worker.c b/servers/vfs/worker.c index 2eb74c270..b34dada80 100644 --- a/servers/vfs/worker.c +++ b/servers/vfs/worker.c @@ -122,7 +122,7 @@ static void *worker_main(void *arg) /* Perform normal work, if any. */ if (fp->fp_func != NULL) { - self->w_msg = fp->fp_msg; + self->w_m_in = fp->fp_msg; err_code = OK; fp->fp_func(); @@ -132,7 +132,7 @@ static void *worker_main(void *arg) /* Perform postponed PM work, if any. */ if (fp->fp_flags & FP_PM_WORK) { - self->w_msg = fp->fp_pm_msg; + self->w_m_in = fp->fp_pm_msg; service_pm_postponed(); diff --git a/servers/vfs/write.c b/servers/vfs/write.c index 9ba0cb849..c56fe14c0 100644 --- a/servers/vfs/write.c +++ b/servers/vfs/write.c @@ -13,7 +13,7 @@ /*===========================================================================* * do_write * *===========================================================================*/ -int do_write(message *UNUSED(m_out)) +int do_write(void) { /* Perform the write(fd, buffer, nbytes) system call. */ return(do_read_write_peek(WRITING, job_m_in.fd,