From f73f35898343587c73fd60422f7c2b15d42bae85 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 25 Sep 1994 19:34:02 +0000 Subject: [PATCH] While in the real world, I had a bad case of being swapped out for a lot of cycles. While waiting there I added a lot of the extra ()'s I have, (I have never used LISP to any extent). So I compiled the kernel with -Wall and shut up a lot of "suggest you add ()'s", removed a bunch of unused var's and added a couple of declarations here and there. Having a lap-top is highly recommended. My kernel still runs, yell at me if you kernel breaks. --- sys/amd64/include/cpufunc.h | 11 ++++-- sys/i386/include/cpufunc.h | 11 ++++-- sys/kern/imgact_aout.c | 4 +- sys/kern/imgact_shell.c | 4 +- sys/kern/init_main.c | 4 +- sys/kern/kern_clock.c | 4 +- sys/kern/kern_descrip.c | 79 +++++++++++++++++++------------------ sys/kern/kern_exec.c | 22 +++++------ sys/kern/kern_exit.c | 18 ++++----- sys/kern/kern_lockf.c | 15 +++---- sys/kern/kern_physio.c | 4 +- sys/kern/kern_proc.c | 7 ++-- sys/kern/kern_prot.c | 14 +++---- sys/kern/kern_resource.c | 12 +++--- sys/kern/kern_sig.c | 24 +++++------ sys/kern/kern_synch.c | 4 +- sys/kern/kern_tc.c | 4 +- sys/kern/kern_time.c | 14 +++---- sys/kern/kern_timeout.c | 4 +- sys/kern/kern_xxx.c | 10 ++--- sys/kern/subr_clist.c | 6 +-- sys/kern/subr_log.c | 8 ++-- sys/kern/sys_generic.c | 21 +++++----- sys/kern/sys_process.c | 14 +++---- sys/kern/tty_subr.c | 6 +-- sys/kern/vfs_bio.c | 23 +++++------ sys/kern/vfs_export.c | 25 ++++++------ sys/kern/vfs_subr.c | 25 ++++++------ sys/sys/bio.h | 30 ++++++++------ sys/sys/buf.h | 30 ++++++++------ sys/sys/signalvar.h | 6 +-- sys/sys/vnode.h | 3 +- 32 files changed, 239 insertions(+), 227 deletions(-) diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index c2992188e12..f0308f0f6eb 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.23 1994/09/16 11:22:33 jkh Exp $ + * $Id: cpufunc.h,v 1.24 1994/09/16 13:33:30 davidg Exp $ */ /* @@ -188,9 +188,12 @@ extern void DELAY(int); void setidt __P((int, void (*)(), int, int)); extern u_long kvtop(void *); -extern void outsb(int /*u_short*/, void *, size_t); -extern void outsw(int /*u_short*/, void *, size_t); -extern void insw(int /*u_short*/, void *, size_t); +extern void * outsb(int /*u_short*/, void *, size_t); +extern void * outsw(int /*u_short*/, void *, size_t); +extern void * outsl(int /*u_short*/, void *, size_t); +extern void * insb(int /*u_short*/, void *, size_t); +extern void * insw(int /*u_short*/, void *, size_t); +extern void * insl(int /*u_short*/, void *, size_t); extern void fillw(int /*u_short*/, void *, size_t); extern void filli(int, void *, size_t); diff --git a/sys/i386/include/cpufunc.h b/sys/i386/include/cpufunc.h index c2992188e12..f0308f0f6eb 100644 --- a/sys/i386/include/cpufunc.h +++ b/sys/i386/include/cpufunc.h @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cpufunc.h,v 1.23 1994/09/16 11:22:33 jkh Exp $ + * $Id: cpufunc.h,v 1.24 1994/09/16 13:33:30 davidg Exp $ */ /* @@ -188,9 +188,12 @@ extern void DELAY(int); void setidt __P((int, void (*)(), int, int)); extern u_long kvtop(void *); -extern void outsb(int /*u_short*/, void *, size_t); -extern void outsw(int /*u_short*/, void *, size_t); -extern void insw(int /*u_short*/, void *, size_t); +extern void * outsb(int /*u_short*/, void *, size_t); +extern void * outsw(int /*u_short*/, void *, size_t); +extern void * outsl(int /*u_short*/, void *, size_t); +extern void * insb(int /*u_short*/, void *, size_t); +extern void * insw(int /*u_short*/, void *, size_t); +extern void * insl(int /*u_short*/, void *, size_t); extern void fillw(int /*u_short*/, void *, size_t); extern void filli(int, void *, size_t); diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index f42f1b84da1..c700c261fda 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: imgact_aout.c,v 1.7 1994/08/24 11:50:36 sos Exp $ + * $Id: imgact_aout.c,v 1.8 1994/09/24 21:36:50 davidg Exp $ */ #include @@ -51,7 +51,7 @@ exec_aout_imgact(iparams) struct vmspace *vmspace = iparams->proc->p_vmspace; unsigned long vmaddr, virtual_offset, file_offset; unsigned long bss_size; - int error, len; + int error; extern struct sysentvec aout_sysvec; /* diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c index 2884231b0f1..8340221b035 100644 --- a/sys/kern/imgact_shell.c +++ b/sys/kern/imgact_shell.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: imgact_shell.c,v 1.4 1994/08/13 03:50:23 wollman Exp $ + * $Id: imgact_shell.c,v 1.5 1994/08/18 22:34:56 wollman Exp $ */ #include @@ -57,9 +57,7 @@ exec_shell_imgact(iparams) { const char *image_header = iparams->image_header; const char *ihp, *line_endp; - int length; char *interp; - char **argv; /* a shell script? */ if (((short *) image_header)[0] != SHELLMAGIC) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 146c0e38f14..41693b21ed1 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.9 1994/09/01 11:20:11 davidg Exp $ + * $Id: init_main.c,v 1.10 1994/09/13 14:46:47 dfr Exp $ */ #include @@ -124,11 +124,9 @@ main(framep) { register struct proc *p; register struct filedesc0 *fdp; - register struct pdevinit *pdev; register int i; int s, rval[2]; extern int (*mountroot) __P((void)); - extern struct pdevinit pdevinit[]; extern void roundrobin __P((void *)); extern void schedcpu __P((void *)); extern struct sysentvec aout_sysvec; diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 6b3f85f2707..d72c2844ab7 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.5 1994/08/27 16:14:26 davidg Exp $ + * $Id: kern_clock.c,v 1.6 1994/09/18 20:39:46 wollman Exp $ */ /* Portions of this software are covered by the following: */ @@ -411,7 +411,7 @@ hardclock(frame) { register struct callout *p1; register struct proc *p; - register int delta, needsoft; + register int needsoft; extern int tickdelta; extern long timedelta; diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index c48ccba0a4a..e94a5187ebc 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_descrip.c 8.6 (Berkeley) 4/19/94 - * $Id: kern_descrip.c,v 1.3 1994/08/02 07:41:55 davidg Exp $ + * $Id: kern_descrip.c,v 1.4 1994/09/02 10:17:30 davidg Exp $ */ #include @@ -56,6 +56,7 @@ #include #include +int finishdup(struct filedesc *fdp, int old, int new, int *retval); /* * Descriptor management. */ @@ -80,37 +81,6 @@ getdtablesize(p, uap, retval) return (0); } -/* - * Duplicate a file descriptor. - */ -struct dup_args { - u_int fd; -}; -/* ARGSUSED */ -int -dup(p, uap, retval) - struct proc *p; - struct dup_args *uap; - int *retval; -{ - register struct filedesc *fdp; - u_int old; - int new, error; - - old = uap->fd; - /* - * XXX Compatibility - */ - if (old &~ 077) { uap->fd &= 077; return (dup2(p, uap, retval)); } - - fdp = p->p_fd; - if (old >= fdp->fd_nfiles || fdp->fd_ofiles[old] == NULL) - return (EBADF); - if (error = fdalloc(p, 0, &new)) - return (error); - return (finishdup(fdp, (int)old, new, retval)); -} - /* * Duplicate a file descriptor to a particular value. */ @@ -139,7 +109,7 @@ dup2(p, uap, retval) return (0); } if (new >= fdp->fd_nfiles) { - if (error = fdalloc(p, new, &i)) + if ((error = fdalloc(p, new, &i))) return (error); if (new != i) panic("dup2: fdalloc"); @@ -154,6 +124,37 @@ dup2(p, uap, retval) return (finishdup(fdp, (int)old, (int)new, retval)); } +/* + * Duplicate a file descriptor. + */ +struct dup_args { + u_int fd; +}; +/* ARGSUSED */ +int +dup(p, uap, retval) + struct proc *p; + struct dup_args *uap; + int *retval; +{ + register struct filedesc *fdp; + u_int old; + int new, error; + + old = uap->fd; + /* + * XXX Compatibility + */ + if (old &~ 077) { uap->fd &= 077; return (dup2(p, uap, retval)); } + + fdp = p->p_fd; + if (old >= fdp->fd_nfiles || fdp->fd_ofiles[old] == NULL) + return (EBADF); + if ((error = fdalloc(p, 0, &new))) + return (error); + return (finishdup(fdp, (int)old, new, retval)); +} + /* * The file control system call. */ @@ -188,7 +189,7 @@ fcntl(p, uap, retval) if (newmin >= p->p_rlimit[RLIMIT_NOFILE].rlim_cur || newmin >= maxfiles) return (EINVAL); - if (error = fdalloc(p, newmin, &i)) + if ((error = fdalloc(p, newmin, &i))) return (error); return (finishdup(fdp, uap->fd, i, retval)); @@ -292,7 +293,7 @@ fcntl(p, uap, retval) return (error); if (fl.l_whence == SEEK_CUR) fl.l_start += fp->f_offset; - if (error = VOP_ADVLOCK(vp, (caddr_t)p, F_GETLK, &fl, F_POSIX)) + if ((error = VOP_ADVLOCK(vp,(caddr_t)p,F_GETLK,&fl,F_POSIX))) return (error); return (copyout((caddr_t)&fl, (caddr_t)uap->arg, sizeof (fl))); @@ -587,7 +588,7 @@ falloc(p, resultfp, resultfd) register struct file *fp, *fq, **fpp; int error, i; - if (error = fdalloc(p, 0, &i)) + if ((error = fdalloc(p, 0, &i))) return (error); if (nfiles >= maxfiles) { tablefull("file"); @@ -602,12 +603,12 @@ falloc(p, resultfp, resultfd) nfiles++; MALLOC(fp, struct file *, sizeof(struct file), M_FILE, M_WAITOK); bzero(fp, sizeof(struct file)); - if (fq = p->p_fd->fd_ofiles[0]) + if ((fq = p->p_fd->fd_ofiles[0])) fpp = &fq->f_filef; else fpp = &filehead; p->p_fd->fd_ofiles[i] = fp; - if (fq = *fpp) + if ((fq = *fpp)) fq->f_fileb = &fp->f_filef; fp->f_filef = fq; fp->f_fileb = fpp; @@ -631,7 +632,7 @@ ffree(fp) { register struct file *fq; - if (fq = fp->f_filef) + if ((fq = fp->f_filef)) fq->f_fileb = fp->f_fileb; *fp->f_fileb = fq; crfree(fp->f_cred); diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 2e8d719cb31..6d1aa2e0ed9 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.7 1994/09/14 05:52:13 davidg Exp $ + * $Id: kern_exec.c,v 1.8 1994/09/24 16:58:43 davidg Exp $ */ #include @@ -73,9 +73,8 @@ execve(p, uap, retval) int *retval; { struct nameidata nd, *ndp; - char *stringbase, *stringp; int *stack_base; - int error, resid, len, i; + int error, len, i; struct image_params image_params, *iparams; struct vnode *vnodep; struct vattr attr; @@ -385,11 +384,11 @@ exec_extract_strings(iparams) argv = iparams->uap->argv; if (argv) { - while (argp = (caddr_t) fuword(argv++)) { + while ((argp = (caddr_t) fuword(argv++))) { if (argp == (caddr_t) -1) return (EFAULT); - if (error = copyinstr(argp, iparams->stringp, - iparams->stringspace, &length)) { + if ((error = copyinstr(argp, iparams->stringp, + iparams->stringspace, &length))) { if (error == ENAMETOOLONG) return(E2BIG); return (error); @@ -407,11 +406,11 @@ exec_extract_strings(iparams) envv = iparams->uap->envv; if (envv) { - while (envp = (caddr_t) fuword(envv++)) { + while ((envp = (caddr_t) fuword(envv++))) { if (envp == (caddr_t) -1) return (EFAULT); - if (error = copyinstr(envp, iparams->stringp, - iparams->stringspace, &length)) { + if ((error = copyinstr(envp, iparams->stringp, + iparams->stringspace, &length))) { if (error == ENAMETOOLONG) return(E2BIG); return (error); @@ -438,7 +437,6 @@ exec_copyout_strings(iparams) char **vectp; char *stringp, *destp; int *stack_base; - int vect_table_size, string_table_size; struct ps_strings *arginfo; /* @@ -473,7 +471,7 @@ exec_copyout_strings(iparams) */ for (; argc > 0; --argc) { *(vectp++) = destp; - while (*destp++ = *stringp++); + while ((*destp++ = *stringp++)); } /* a null vector table pointer seperates the argp's from the envp's */ @@ -487,7 +485,7 @@ exec_copyout_strings(iparams) */ for (; envc > 0; --envc) { *(vectp++) = destp; - while (*destp++ = *stringp++); + while ((*destp++ = *stringp++)); } /* end of vector table is a null pointer */ diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 5fe6faadad9..82d303bcf2d 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_exit.c 8.7 (Berkeley) 2/12/94 - * $Id: kern_exit.c,v 1.5 1994/08/24 11:50:39 sos Exp $ + * $Id: kern_exit.c,v 1.6 1994/09/12 11:27:03 davidg Exp $ */ #include @@ -194,9 +194,9 @@ exit1(p, rv) * Remove proc from allproc queue and pidhash chain. * Place onto zombproc. Unlink from parent's child list. */ - if (*p->p_prev = p->p_next) + if ((*p->p_prev = p->p_next)) p->p_next->p_prev = p->p_prev; - if (p->p_next = zombproc) + if ((p->p_next = zombproc)) p->p_next->p_prev = &p->p_next; p->p_prev = &zombproc; zombproc = p; @@ -382,8 +382,8 @@ wait1(q, uap, retval) #endif if (uap->status) { status = p->p_xstat; /* convert to int */ - if (error = copyout((caddr_t)&status, - (caddr_t)uap->status, sizeof(status))) + if ((error = copyout((caddr_t)&status, + (caddr_t)uap->status, sizeof(status)))) return (error); } if (uap->rusage && (error = copyout((caddr_t)p->p_ru, @@ -428,11 +428,11 @@ wait1(q, uap, retval) * Unlink it from its process group and free it. */ leavepgrp(p); - if (*p->p_prev = p->p_next) /* off zombproc */ + if ((*p->p_prev = p->p_next)) /* off zombproc */ p->p_next->p_prev = p->p_prev; - if (q = p->p_ysptr) + if ((q = p->p_ysptr)) q->p_osptr = p->p_osptr; - if (q = p->p_osptr) + if ((q = p->p_osptr)) q->p_ysptr = p->p_ysptr; if ((q = p->p_pptr)->p_cptr == p) q->p_cptr = p->p_osptr; @@ -472,7 +472,7 @@ wait1(q, uap, retval) retval[0] = 0; return (0); } - if (error = tsleep((caddr_t)q, PWAIT | PCATCH, "wait", 0)) + if ((error = tsleep((caddr_t)q, PWAIT | PCATCH, "wait", 0))) return (error); goto loop; } diff --git a/sys/kern/kern_lockf.c b/sys/kern/kern_lockf.c index ab2238ba7f5..654e0f2cda5 100644 --- a/sys/kern/kern_lockf.c +++ b/sys/kern/kern_lockf.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94 - * $Id: ufs_lockf.c,v 1.2 1994/08/02 07:54:57 davidg Exp $ + * $Id: kern_lockf.c,v 1.1 1994/08/08 17:30:48 davidg Exp $ */ #include @@ -182,7 +182,7 @@ lf_setlock(lock) /* * Scan lock list for this file looking for locks that would block us. */ - while (block = lf_getblock(lock)) { + while ((block = lf_getblock(lock))) { /* * Free the structure and return if nonblocking. */ @@ -246,7 +246,7 @@ lf_setlock(lock) lf_printlist("lf_setlock", block); } #endif /* LOCKF_DEBUG */ - if (error = tsleep((caddr_t)lock, priority, lockstr, 0)) { + if ((error = tsleep((caddr_t)lock, priority, lockstr, 0))) { /* * Delete ourselves from the waiting to lock list. */ @@ -281,7 +281,8 @@ lf_setlock(lock) block = *head; needtolink = 1; for (;;) { - if (ovcase = lf_findoverlap(block, lock, SELF, &prev, &overlap)) + ovcase = lf_findoverlap(block, lock, SELF, &prev, &overlap); + if (ovcase) block = overlap->lf_next; /* * Six cases: @@ -416,7 +417,7 @@ lf_clearlock(unlock) lf_print("lf_clearlock", unlock); #endif /* LOCKF_DEBUG */ prev = head; - while (ovcase = lf_findoverlap(lf, unlock, SELF, &prev, &overlap)) { + while ((ovcase = lf_findoverlap(lf, unlock, SELF, &prev, &overlap))) { /* * Wakeup the list of locks to be retried. */ @@ -479,7 +480,7 @@ lf_getlock(lock, fl) lf_print("lf_getlock", lock); #endif /* LOCKF_DEBUG */ - if (block = lf_getblock(lock)) { + if ((block = lf_getblock(lock))) { fl->l_type = block->lf_type; fl->l_whence = SEEK_SET; fl->l_start = block->lf_start; @@ -509,7 +510,7 @@ lf_getblock(lock) int ovcase; prev = lock->lf_head; - while (ovcase = lf_findoverlap(lf, lock, OTHERS, &prev, &overlap)) { + while ((ovcase = lf_findoverlap(lf, lock, OTHERS, &prev, &overlap))) { /* * We've found an overlap, see if it blocks us */ diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index e29d0b980fe..4a33c462cbc 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: kern_physio.c,v 1.6 1994/08/08 13:53:55 davidg Exp $ + * $Id: kern_physio.c,v 1.7 1994/08/18 22:35:02 wollman Exp $ */ #include @@ -74,8 +74,6 @@ physio(strategy, bp, dev, rw, minp, uio) for(i=0;iuio_iovcnt;i++) { while( uio->uio_iov[i].iov_len) { - vm_offset_t v, lastv, pa; - caddr_t adr; bp->b_bcount = uio->uio_iov[i].iov_len; bp->b_bcount = minp( bp); diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index e130b64906e..989cf1cb410 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_proc.c 8.4 (Berkeley) 1/4/94 - * $Id: kern_proc.c,v 1.4 1994/08/18 22:35:03 wollman Exp $ + * $Id: kern_proc.c,v 1.5 1994/09/01 05:12:39 davidg Exp $ */ #include @@ -49,6 +49,7 @@ #include #include #include +#include struct prochd qs[NQS]; /* as good a place as any... */ struct prochd rtqs[NQS]; /* Space for REALTIME queues too */ @@ -102,7 +103,7 @@ chgproccnt(uid, diff) return (uip->ui_proccnt); if (uip->ui_proccnt < 0) panic("chgproccnt: procs < 0"); - if (uiq = uip->ui_next) + if ((uiq = uip->ui_next)) uiq->ui_prev = uip->ui_prev; *uip->ui_prev = uiq; FREE(uip, M_PROC); @@ -114,7 +115,7 @@ chgproccnt(uid, diff) panic("chgproccnt: lost user"); } MALLOC(uip, struct uidinfo *, sizeof(*uip), M_PROC, M_WAITOK); - if (uiq = *uipp) + if ((uiq = *uipp)) uiq->ui_prev = &uip->ui_next; uip->ui_next = uiq; uip->ui_prev = uipp; diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c index 50458ad8839..fab5e45a6ea 100644 --- a/sys/kern/kern_prot.c +++ b/sys/kern/kern_prot.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_prot.c 8.6 (Berkeley) 1/21/94 - * $Id$ + * $Id: kern_prot.c,v 1.3 1994/08/02 07:42:08 davidg Exp $ */ /* @@ -175,8 +175,8 @@ getgroups(p, uap, retval) if (ngrp < pc->pc_ucred->cr_ngroups) return (EINVAL); ngrp = pc->pc_ucred->cr_ngroups; - if (error = copyout((caddr_t)pc->pc_ucred->cr_groups, - (caddr_t)uap->gidset, ngrp * sizeof(gid_t))) + if ((error = copyout((caddr_t)pc->pc_ucred->cr_groups, + (caddr_t)uap->gidset, ngrp * sizeof(gid_t)))) return (error); *retval = ngrp; return (0); @@ -371,13 +371,13 @@ setgroups(p, uap, retval) register u_int ngrp; int error; - if (error = suser(pc->pc_ucred, &p->p_acflag)) + if ((error = suser(pc->pc_ucred, &p->p_acflag))) return (error); if ((ngrp = uap->gidsetsize) > NGROUPS) return (EINVAL); pc->pc_ucred = crcopy(pc->pc_ucred); - if (error = copyin((caddr_t)uap->gidset, - (caddr_t)pc->pc_ucred->cr_groups, ngrp * sizeof(gid_t))) + if ((error = copyin((caddr_t)uap->gidset, + (caddr_t)pc->pc_ucred->cr_groups, ngrp * sizeof(gid_t)))) return (error); pc->pc_ucred->cr_ngroups = ngrp; p->p_flag |= P_SUGID; @@ -578,7 +578,7 @@ setlogin(p, uap, retval) { int error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); error = copyinstr((caddr_t) uap->namebuf, (caddr_t) p->p_pgrp->pg_session->s_login, diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 06d749cd7c1..704c5019cb6 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.3 1994/08/02 07:42:10 davidg Exp $ + * $Id: kern_resource.c,v 1.4 1994/09/01 05:12:40 davidg Exp $ */ #include @@ -267,8 +267,8 @@ osetrlimit(p, uap, retval) struct rlimit lim; int error; - if (error = - copyin((caddr_t)uap->lim, (caddr_t)&olim, sizeof (struct orlimit))) + if ((error = + copyin((caddr_t)uap->lim, (caddr_t)&olim, sizeof(struct orlimit)))) return (error); lim.rlim_cur = olim.rlim_cur; lim.rlim_max = olim.rlim_max; @@ -314,8 +314,8 @@ setrlimit(p, uap, retval) struct rlimit alim; int error; - if (error = - copyin((caddr_t)uap->lim, (caddr_t)&alim, sizeof (struct rlimit))) + if ((error = + copyin((caddr_t)uap->lim, (caddr_t)&alim, sizeof (struct rlimit)))) return (error); return (dosetrlimit(p, uap->which, &alim)); } @@ -334,7 +334,7 @@ dosetrlimit(p, which, limp) alimp = &p->p_rlimit[which]; if (limp->rlim_cur > alimp->rlim_max || limp->rlim_max > alimp->rlim_max) - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); if (limp->rlim_cur > limp->rlim_max) limp->rlim_cur = limp->rlim_max; diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 5500a4ac9d9..dcc553ad8ea 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 - * $Id: kern_sig.c,v 1.3 1994/08/02 07:42:13 davidg Exp $ + * $Id: kern_sig.c,v 1.4 1994/09/20 05:42:46 bde Exp $ */ #define SIGPROP /* include signal properties table */ @@ -112,13 +112,13 @@ sigaction(p, uap, retval) sa->sa_flags |= SA_RESTART; if (p->p_flag & P_NOCLDSTOP) sa->sa_flags |= SA_NOCLDSTOP; - if (error = copyout((caddr_t)sa, (caddr_t)uap->osa, - sizeof (vec))) + if ((error = copyout((caddr_t)sa, (caddr_t)uap->osa, + sizeof (vec)))) return (error); } if (uap->nsa) { - if (error = copyin((caddr_t)uap->nsa, (caddr_t)sa, - sizeof (vec))) + if ((error = copyin((caddr_t)uap->nsa, (caddr_t)sa, + sizeof (vec)))) return (error); setsigvec(p, signum, sa); } @@ -331,13 +331,13 @@ osigvec(p, uap, retval) if (p->p_flag & P_NOCLDSTOP) sv->sv_flags |= SA_NOCLDSTOP; #endif - if (error = copyout((caddr_t)sv, (caddr_t)uap->osv, - sizeof (vec))) + if ((error = copyout((caddr_t)sv, (caddr_t)uap->osv, + sizeof (vec)))) return (error); } if (uap->nsv) { - if (error = copyin((caddr_t)uap->nsv, (caddr_t)sv, - sizeof (vec))) + if ((error = copyin((caddr_t)uap->nsv, (caddr_t)sv, + sizeof (vec)))) return (error); #ifdef COMPAT_SUNOS /* @@ -479,7 +479,7 @@ sigaltstack(p, uap, retval) return (error); if (uap->nss == 0) return (0); - if (error = copyin((caddr_t)uap->nss, (caddr_t)&ss, sizeof (ss))) + if ((error = copyin((caddr_t)uap->nss, (caddr_t)&ss, sizeof (ss)))) return (error); if (ss.ss_flags & SA_DISABLE) { if (psp->ps_sigstk.ss_flags & SA_ONSTACK) @@ -1164,8 +1164,8 @@ coredump(p) return (EFAULT); sprintf(name, "%s.core", p->p_comm); NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, name, p); - if (error = vn_open(&nd, - O_CREAT | FWRITE, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) + if ((error = vn_open(&nd, + O_CREAT | FWRITE, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) return (error); vp = nd.ni_vp; diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index f667c87b135..c74469f11a4 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_synch.c 8.6 (Berkeley) 1/21/94 - * $Id: kern_synch.c,v 1.3 1994/08/02 07:42:17 davidg Exp $ + * $Id: kern_synch.c,v 1.4 1994/09/01 05:12:41 davidg Exp $ */ #include @@ -334,7 +334,7 @@ tsleep(ident, priority, wmesg, timo) */ if (catch) { p->p_flag |= P_SINTR; - if (sig = CURSIG(p)) { + if ((sig = CURSIG(p))) { if (p->p_wchan) unsleep(p); p->p_stat = SRUN; diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 6b3f85f2707..d72c2844ab7 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.5 1994/08/27 16:14:26 davidg Exp $ + * $Id: kern_clock.c,v 1.6 1994/09/18 20:39:46 wollman Exp $ */ /* Portions of this software are covered by the following: */ @@ -411,7 +411,7 @@ hardclock(frame) { register struct callout *p1; register struct proc *p; - register int delta, needsoft; + register int needsoft; extern int tickdelta; extern long timedelta; diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index d03098341ff..9c226444d1a 100644 --- a/sys/kern/kern_time.c +++ b/sys/kern/kern_time.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_time.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: kern_time.c,v 1.3 1994/08/02 07:42:21 davidg Exp $ */ #include @@ -73,8 +73,8 @@ gettimeofday(p, uap, retval) if (uap->tp) { microtime(&atv); - if (error = copyout((caddr_t)&atv, (caddr_t)uap->tp, - sizeof (atv))) + if ((error = copyout((caddr_t)&atv, (caddr_t)uap->tp, + sizeof (atv)))) return (error); } if (uap->tzp) @@ -98,7 +98,7 @@ settimeofday(p, uap, retval) struct timezone atz; int error, s; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); /* Verify all parameters before changing time. */ if (uap->tv && @@ -148,10 +148,10 @@ adjtime(p, uap, retval) register long ndelta, ntickdelta, odelta; int s, error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); - if (error = - copyin((caddr_t)uap->delta, (caddr_t)&atv, sizeof(struct timeval))) + if ((error = + copyin((caddr_t)uap->delta, (caddr_t)&atv, sizeof(struct timeval)))) return (error); /* diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 6b3f85f2707..d72c2844ab7 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_clock.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_clock.c,v 1.5 1994/08/27 16:14:26 davidg Exp $ + * $Id: kern_clock.c,v 1.6 1994/09/18 20:39:46 wollman Exp $ */ /* Portions of this software are covered by the following: */ @@ -411,7 +411,7 @@ hardclock(frame) { register struct callout *p1; register struct proc *p; - register int delta, needsoft; + register int needsoft; extern int tickdelta; extern long timedelta; diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index 18b61a62aa3..0ada2b3e034 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_xxx.c 8.2 (Berkeley) 11/14/93 - * $Id: kern_xxx.c,v 1.5 1994/08/18 22:35:04 wollman Exp $ + * $Id: kern_xxx.c,v 1.6 1994/09/19 21:15:14 ache Exp $ */ #include @@ -55,7 +55,7 @@ reboot(p, uap, retval) { int error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); boot(uap->opt); return (0); @@ -94,7 +94,7 @@ osethostname(p, uap, retval) int name; int error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); name = KERN_HOSTNAME; return (kern_sysctl(&name, 1, 0, 0, uap->hostname, uap->len, p)); @@ -129,7 +129,7 @@ osethostid(p, uap, retval) { int error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); hostid = uap->hostid; return (0); @@ -252,7 +252,7 @@ setdomainname(p, uap, retval) { int error; - if (error = suser(p->p_ucred, &p->p_acflag)) + if ((error = suser(p->p_ucred, &p->p_acflag))) return (error); if (uap->len > sizeof (domainname) - 1) return EINVAL; diff --git a/sys/kern/subr_clist.c b/sys/kern/subr_clist.c index 98824d9948d..26f42fbccdb 100644 --- a/sys/kern/subr_clist.c +++ b/sys/kern/subr_clist.c @@ -6,7 +6,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: tty_subr.c,v 1.5 1994/08/02 07:42:53 davidg Exp $ + * $Id: tty_subr.c,v 1.6 1994/09/13 16:02:20 davidg Exp $ */ /* @@ -274,7 +274,7 @@ putc(chr, clistp) int chr; struct clist *clistp; { - struct cblock *cblockp, *bclockn; + struct cblock *cblockp; int s; s = spltty(); @@ -329,7 +329,7 @@ b_to_q(src, amount, clistp) int amount; struct clist *clistp; { - struct cblock *cblockp, *bclockn; + struct cblock *cblockp; char *firstbyte, *lastbyte; u_char startmask, endmask; int startbit, endbit, num_between, numc; diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 751b7417581..35274fc4981 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)subr_log.c 8.1 (Berkeley) 6/10/93 - * $Id$ + * $Id: subr_log.c,v 1.3 1994/08/02 07:42:29 davidg Exp $ */ /* @@ -120,8 +120,8 @@ logread(dev, uio, flag) return (EWOULDBLOCK); } logsoftc.sc_state |= LOG_RDWAIT; - if (error = tsleep((caddr_t)mbp, LOG_RDPRI | PCATCH, - "klog", 0)) { + if ((error = tsleep((caddr_t)mbp, LOG_RDPRI | PCATCH, + "klog", 0))) { splx(s); return (error); } @@ -181,7 +181,7 @@ logwakeup() if (logsoftc.sc_state & LOG_ASYNC) { if (logsoftc.sc_pgid < 0) gsignal(-logsoftc.sc_pgid, SIGIO); - else if (p = pfind(logsoftc.sc_pgid)) + else if ((p = pfind(logsoftc.sc_pgid))) psignal(p, SIGIO); } if (logsoftc.sc_state & LOG_RDWAIT) { diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 9df97422597..167e1294be8 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 - * $Id: sys_generic.c,v 1.4 1994/09/02 14:04:39 davidg Exp $ + * $Id: sys_generic.c,v 1.5 1994/09/02 15:06:39 davidg Exp $ */ #include @@ -103,7 +103,7 @@ read(p, uap, retval) ktriov = aiov; #endif cnt = uap->nbyte; - if (error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred)) + if ((error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred))) if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; @@ -162,7 +162,7 @@ readv(p, uap, retval) auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_procp = p; - if (error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen)) + if ((error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen))) goto done; auio.uio_resid = 0; for (i = 0; i < uap->iovcnt; i++) { @@ -183,7 +183,7 @@ readv(p, uap, retval) } #endif cnt = auio.uio_resid; - if (error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred)) + if ((error = (*fp->f_ops->fo_read)(fp, &auio, fp->f_cred))) if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; @@ -222,7 +222,6 @@ write(p, uap, retval) struct uio auio; struct iovec aiov; long cnt, error = 0; - int i; #ifdef KTRACE struct iovec ktriov; #endif @@ -247,7 +246,7 @@ write(p, uap, retval) ktriov = aiov; #endif cnt = uap->nbyte; - if (error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred)) { + if ((error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred))) { if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; @@ -310,7 +309,7 @@ writev(p, uap, retval) auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_USERSPACE; auio.uio_procp = p; - if (error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen)) + if ((error = copyin((caddr_t)uap->iovp, (caddr_t)iov, iovlen))) goto done; auio.uio_resid = 0; for (i = 0; i < uap->iovcnt; i++) { @@ -331,7 +330,7 @@ writev(p, uap, retval) } #endif cnt = auio.uio_resid; - if (error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred)) { + if ((error = (*fp->f_ops->fo_write)(fp, &auio, fp->f_cred))) { if (auio.uio_resid != cnt && (error == ERESTART || error == EINTR || error == EWOULDBLOCK)) error = 0; @@ -430,7 +429,7 @@ ioctl(p, uap, retval) switch (com) { case FIONBIO: - if (tmp = *(int *)data) + if ((tmp = *(int *)data)) fp->f_flag |= FNONBLOCK; else fp->f_flag &= ~FNONBLOCK; @@ -438,7 +437,7 @@ ioctl(p, uap, retval) break; case FIOASYNC: - if (tmp = *(int *)data) + if ((tmp = *(int *)data)) fp->f_flag |= FASYNC; else fp->f_flag &= ~FASYNC; @@ -558,7 +557,7 @@ select(p, uap, retval) s = splhigh(); /* this should be timercmp(&time, &atv, >=) */ if (uap->tv && (time.tv_sec > atv.tv_sec || - time.tv_sec == atv.tv_sec && time.tv_usec >= atv.tv_usec)) { + (time.tv_sec == atv.tv_sec && time.tv_usec >= atv.tv_usec))) { splx(s); goto done; } diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 2e886d39eb8..63537bdbeb2 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: sys_process.c,v 1.5 1994/08/13 03:50:25 wollman Exp $ + * $Id: sys_process.c,v 1.6 1994/08/18 22:35:05 wollman Exp $ */ #include @@ -204,7 +204,7 @@ ptrace(curp, uap, retval) int *retval; { struct proc *p; - int s, error = 0; + int error = 0; *retval = 0; if (uap->req == PT_TRACE_ME) { @@ -280,17 +280,17 @@ ptrace(curp, uap, retval) case PT_READ_I: case PT_READ_D: - if (error = pread (p, (unsigned int)uap->addr, retval)) + if ((error = pread (p, (unsigned int)uap->addr, retval))) return error; return 0; case PT_WRITE_I: case PT_WRITE_D: - if (error = pwrite (p, (unsigned int)uap->addr, - (unsigned int)uap->data)) + if ((error = pwrite (p, (unsigned int)uap->addr, + (unsigned int)uap->data))) return error; return 0; case PT_STEP: - if (error = ptrace_single_step (p)) + if ((error = ptrace_single_step (p))) return error; /* fallthrough */ case PT_CONTINUE: @@ -308,7 +308,7 @@ ptrace(curp, uap, retval) if (uap->addr != (caddr_t)1) { fill_eproc (p, &p->p_addr->u_kproc.kp_eproc); - if (error = ptrace_set_pc (p, uap->addr)) + if ((error = ptrace_set_pc (p, uap->addr))) return error; } diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c index 98824d9948d..26f42fbccdb 100644 --- a/sys/kern/tty_subr.c +++ b/sys/kern/tty_subr.c @@ -6,7 +6,7 @@ * of this software, nor does the author assume any responsibility * for damages incurred with its use. * - * $Id: tty_subr.c,v 1.5 1994/08/02 07:42:53 davidg Exp $ + * $Id: tty_subr.c,v 1.6 1994/09/13 16:02:20 davidg Exp $ */ /* @@ -274,7 +274,7 @@ putc(chr, clistp) int chr; struct clist *clistp; { - struct cblock *cblockp, *bclockn; + struct cblock *cblockp; int s; s = spltty(); @@ -329,7 +329,7 @@ b_to_q(src, amount, clistp) int amount; struct clist *clistp; { - struct cblock *cblockp, *bclockn; + struct cblock *cblockp; char *firstbyte, *lastbyte; u_char startmask, endmask; int startbit, endbit, num_between, numc; diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 22b5c8ac665..ad981d7b3b4 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -16,7 +16,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: vfs_bio.c,v 1.10 1994/08/30 18:19:11 davidg Exp $ + * $Id: vfs_bio.c,v 1.11 1994/08/31 06:17:37 davidg Exp $ */ #include @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -54,7 +55,8 @@ int vfs_update_wakeup; /* * Initialize buffer headers and related structures. */ -void bufinit() +void +bufinit() { struct buf *bp; int i; @@ -371,19 +373,18 @@ getnewbuf(int slpflag, int slptimeo) s = splbio(); start: /* can we constitute a new buffer? */ - if (bp = bufqueues[QUEUE_EMPTY].tqh_first) { + if ((bp = bufqueues[QUEUE_EMPTY].tqh_first)) { if( bp->b_qindex != QUEUE_EMPTY) panic("getnewbuf: inconsistent EMPTY queue"); bremfree(bp); goto fillbuf; } -tryfree: - if (bp = bufqueues[QUEUE_AGE].tqh_first) { + if ((bp = bufqueues[QUEUE_AGE].tqh_first)) { if( bp->b_qindex != QUEUE_AGE) panic("getnewbuf: inconsistent AGE queue"); bremfree(bp); - } else if (bp = bufqueues[QUEUE_LRU].tqh_first) { + } else if ((bp = bufqueues[QUEUE_LRU].tqh_first)) { if( bp->b_qindex != QUEUE_LRU) panic("getnewbuf: inconsistent LRU queue"); bremfree(bp); @@ -446,7 +447,7 @@ incore(struct vnode *vp, daddr_t blkno) /* Search hash chain */ while (bp) { if( (bp < buf) || (bp >= buf + nbuf)) { - printf("incore: buf out of range: %lx, hash: %d\n", + printf("incore: buf out of range: %p, hash: %d\n", bp, bh - bufhashtbl); panic("incore: buf fault"); } @@ -475,7 +476,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo) s = splbio(); loop: - if (bp = incore(vp, blkno)) { + if ((bp = incore(vp, blkno))) { if (bp->b_flags & B_BUSY) { bp->b_flags |= B_WANTED; tsleep ((caddr_t)bp, PRIBIO, "getblk", 0); @@ -487,7 +488,7 @@ getblk(struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo) * check for size inconsistancies */ if (bp->b_bcount != size) { - printf("getblk: invalid buffer size: %d\n", bp->b_bcount); + printf("getblk: invalid buffer size: %ld\n", bp->b_bcount); bp->b_flags |= B_INVAL; bwrite(bp); goto loop; @@ -680,7 +681,6 @@ vm_hold_load_pages(vm_offset_t froma, vm_offset_t toa) { vm_offset_t to = round_page(toa); for(pg = from ; pg < to ; pg += PAGE_SIZE) { - vm_offset_t pa; tryagain: /* @@ -730,7 +730,8 @@ vm_hold_load_pages(vm_offset_t froma, vm_offset_t toa) { } void -vm_hold_free_pages(vm_offset_t froma, vm_offset_t toa) { +vm_hold_free_pages(vm_offset_t froma, vm_offset_t toa) +{ vm_offset_t pg; vm_page_t p; vm_offset_t from = round_page(froma); diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 3f048ecc43a..9d277d887f5 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.7 1994/08/24 04:06:39 davidg Exp $ + * $Id: vfs_subr.c,v 1.8 1994/08/29 06:08:51 davidg Exp $ */ /* @@ -182,7 +182,7 @@ vfs_unmountroot(rootfs) } mp->mnt_flag |= MNT_UNMOUNT; - if (error = vfs_lock(mp)) { + if ((error = vfs_lock(mp))) { printf("lock of root filesystem failed (%d)\n", error); return; } @@ -190,10 +190,10 @@ vfs_unmountroot(rootfs) vnode_pager_umount(mp); /* release cached vnodes */ cache_purgevfs(mp); /* remove cache entries for this file sys */ - if (error = VFS_SYNC(mp, MNT_WAIT, initproc->p_ucred, initproc)) + if ((error = VFS_SYNC(mp, MNT_WAIT, initproc->p_ucred, initproc))) printf("sync of root filesystem failed (%d)\n", error); - if (error = VFS_UNMOUNT(mp, MNT_FORCE, initproc)) { + if ((error = VFS_UNMOUNT(mp, MNT_FORCE, initproc))) { printf("unmount of root filesystem failed ("); if (error == EBUSY) printf("BUSY)\n"); @@ -324,7 +324,6 @@ getnewvnode(tag, mp, vops, vpp) struct vnode **vpp; { register struct vnode *vp; - int s; if ((vnode_free_list.tqh_first == NULL && numvnodes < 2 * desiredvnodes) || @@ -409,7 +408,7 @@ vwakeup(bp) register struct vnode *vp; bp->b_flags &= ~B_WRITEINPROG; - if (vp = bp->b_vp) { + if ((vp = bp->b_vp)) { vp->v_numoutput--; if (vp->v_numoutput < 0) panic("vwakeup: neg numoutput"); @@ -441,7 +440,7 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo) vm_object_t object; if (flags & V_SAVE) { - if (error = VOP_FSYNC(vp, cred, MNT_WAIT, p)) + if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, p))) return (error); if (vp->v_dirtyblkhd.lh_first != NULL) panic("vinvalbuf: dirty bufs"); @@ -607,7 +606,7 @@ bdevvp(dev, vpp) } vp = nvp; vp->v_type = VBLK; - if (nvp = checkalias(vp, dev, (struct mount *)0)) { + if ((nvp = checkalias(vp, dev, (struct mount *)0))) { vput(vp); vp = nvp; } @@ -888,7 +887,7 @@ vclean(vp, flags) * so that its count cannot fall to zero and generate a * race against ourselves to recycle it. */ - if (active = vp->v_usecount) + if ((active = vp->v_usecount)) VREF(vp); /* * Even if the count is zero, the VOP_INACTIVE routine may still @@ -1140,7 +1139,7 @@ vprint(label, vp) if (label != NULL) printf("%s: ", label); - printf("type %s, usecount %d, writecount %d, refcount %d,", + printf("type %s, usecount %d, writecount %d, refcount %ld,", typename[vp->v_type], vp->v_usecount, vp->v_writecount, vp->v_holdcnt); buf[0] = '\0'; @@ -1308,7 +1307,7 @@ vfs_hang_addrlist(mp, nep, argp) np = (struct netcred *)malloc(i, M_NETADDR, M_WAITOK); bzero((caddr_t)np, i); saddr = (struct sockaddr *)(np + 1); - if (error = copyin(argp->ex_addr, (caddr_t)saddr, argp->ex_addrlen)) + if ((error = copyin(argp->ex_addr, (caddr_t)saddr, argp->ex_addrlen))) goto out; if (saddr->sa_len > argp->ex_addrlen) saddr->sa_len = argp->ex_addrlen; @@ -1376,7 +1375,7 @@ vfs_free_addrlist(nep) register struct radix_node_head *rnh; for (i = 0; i <= AF_MAX; i++) - if (rnh = nep->ne_rtable[i]) { + if ((rnh = nep->ne_rtable[i])) { (*rnh->rnh_walktree)(rnh, vfs_free_netcred, (caddr_t)rnh); free((caddr_t)rnh, M_RTABLE); @@ -1397,7 +1396,7 @@ vfs_export(mp, nep, argp) mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); } if (argp->ex_flags & MNT_EXPORTED) { - if (error = vfs_hang_addrlist(mp, nep, argp)) + if ((error = vfs_hang_addrlist(mp, nep, argp))) return (error); mp->mnt_flag |= MNT_EXPORTED; } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 3f048ecc43a..9d277d887f5 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.7 1994/08/24 04:06:39 davidg Exp $ + * $Id: vfs_subr.c,v 1.8 1994/08/29 06:08:51 davidg Exp $ */ /* @@ -182,7 +182,7 @@ vfs_unmountroot(rootfs) } mp->mnt_flag |= MNT_UNMOUNT; - if (error = vfs_lock(mp)) { + if ((error = vfs_lock(mp))) { printf("lock of root filesystem failed (%d)\n", error); return; } @@ -190,10 +190,10 @@ vfs_unmountroot(rootfs) vnode_pager_umount(mp); /* release cached vnodes */ cache_purgevfs(mp); /* remove cache entries for this file sys */ - if (error = VFS_SYNC(mp, MNT_WAIT, initproc->p_ucred, initproc)) + if ((error = VFS_SYNC(mp, MNT_WAIT, initproc->p_ucred, initproc))) printf("sync of root filesystem failed (%d)\n", error); - if (error = VFS_UNMOUNT(mp, MNT_FORCE, initproc)) { + if ((error = VFS_UNMOUNT(mp, MNT_FORCE, initproc))) { printf("unmount of root filesystem failed ("); if (error == EBUSY) printf("BUSY)\n"); @@ -324,7 +324,6 @@ getnewvnode(tag, mp, vops, vpp) struct vnode **vpp; { register struct vnode *vp; - int s; if ((vnode_free_list.tqh_first == NULL && numvnodes < 2 * desiredvnodes) || @@ -409,7 +408,7 @@ vwakeup(bp) register struct vnode *vp; bp->b_flags &= ~B_WRITEINPROG; - if (vp = bp->b_vp) { + if ((vp = bp->b_vp)) { vp->v_numoutput--; if (vp->v_numoutput < 0) panic("vwakeup: neg numoutput"); @@ -441,7 +440,7 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo) vm_object_t object; if (flags & V_SAVE) { - if (error = VOP_FSYNC(vp, cred, MNT_WAIT, p)) + if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, p))) return (error); if (vp->v_dirtyblkhd.lh_first != NULL) panic("vinvalbuf: dirty bufs"); @@ -607,7 +606,7 @@ bdevvp(dev, vpp) } vp = nvp; vp->v_type = VBLK; - if (nvp = checkalias(vp, dev, (struct mount *)0)) { + if ((nvp = checkalias(vp, dev, (struct mount *)0))) { vput(vp); vp = nvp; } @@ -888,7 +887,7 @@ vclean(vp, flags) * so that its count cannot fall to zero and generate a * race against ourselves to recycle it. */ - if (active = vp->v_usecount) + if ((active = vp->v_usecount)) VREF(vp); /* * Even if the count is zero, the VOP_INACTIVE routine may still @@ -1140,7 +1139,7 @@ vprint(label, vp) if (label != NULL) printf("%s: ", label); - printf("type %s, usecount %d, writecount %d, refcount %d,", + printf("type %s, usecount %d, writecount %d, refcount %ld,", typename[vp->v_type], vp->v_usecount, vp->v_writecount, vp->v_holdcnt); buf[0] = '\0'; @@ -1308,7 +1307,7 @@ vfs_hang_addrlist(mp, nep, argp) np = (struct netcred *)malloc(i, M_NETADDR, M_WAITOK); bzero((caddr_t)np, i); saddr = (struct sockaddr *)(np + 1); - if (error = copyin(argp->ex_addr, (caddr_t)saddr, argp->ex_addrlen)) + if ((error = copyin(argp->ex_addr, (caddr_t)saddr, argp->ex_addrlen))) goto out; if (saddr->sa_len > argp->ex_addrlen) saddr->sa_len = argp->ex_addrlen; @@ -1376,7 +1375,7 @@ vfs_free_addrlist(nep) register struct radix_node_head *rnh; for (i = 0; i <= AF_MAX; i++) - if (rnh = nep->ne_rtable[i]) { + if ((rnh = nep->ne_rtable[i])) { (*rnh->rnh_walktree)(rnh, vfs_free_netcred, (caddr_t)rnh); free((caddr_t)rnh, M_RTABLE); @@ -1397,7 +1396,7 @@ vfs_export(mp, nep, argp) mp->mnt_flag &= ~(MNT_EXPORTED | MNT_DEFEXPORTED); } if (argp->ex_flags & MNT_EXPORTED) { - if (error = vfs_hang_addrlist(mp, nep, argp)) + if ((error = vfs_hang_addrlist(mp, nep, argp))) return (error); mp->mnt_flag |= MNT_EXPORTED; } diff --git a/sys/sys/bio.h b/sys/sys/bio.h index 7072545446d..59738f2f8be 100644 --- a/sys/sys/bio.h +++ b/sys/sys/bio.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)buf.h 8.7 (Berkeley) 1/21/94 - * $Id: buf.h,v 1.5 1994/08/06 09:15:33 davidg Exp $ + * $Id: buf.h,v 1.6 1994/08/18 22:35:40 wollman Exp $ */ #ifndef _SYS_BUF_H_ @@ -187,27 +187,33 @@ extern TAILQ_HEAD(swqueue, buf) bswlist; extern struct buf *bclnlist; /* Head of cleaned page list. */ __BEGIN_DECLS -void allocbuf __P((struct buf *, int)); -void bawrite __P((struct buf *)); -void bdwrite __P((struct buf *)); -void biodone __P((struct buf *)); -int biowait __P((struct buf *)); +void bufinit __P((void)); +void bremfree __P((struct buf *)); int bread __P((struct vnode *, daddr_t, int, struct ucred *, struct buf **)); int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int, struct ucred *, struct buf **)); -void brelse __P((struct buf *)); -void bufinit __P((void)); int bwrite __P((struct buf *)); +void bdwrite __P((struct buf *)); +void bawrite __P((struct buf *)); +void brelse __P((struct buf *)); +struct buf *getnewbuf __P((int slpflag, int slptimeo)); +struct buf *incore __P((struct vnode *, daddr_t)); +struct buf *getblk __P((struct vnode *, daddr_t, int, int, int)); +struct buf *geteblk __P((int)); +void allocbuf __P((struct buf *, int)); +int biowait __P((struct buf *)); +void biodone __P((struct buf *)); + void cluster_callback __P((struct buf *)); int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long, struct ucred *, struct buf **)); void cluster_write __P((struct buf *, u_quad_t)); -struct buf *getblk __P((struct vnode *, daddr_t, int, int, int)); -struct buf *geteblk __P((int)); -struct buf *getnewbuf __P((int slpflag, int slptimeo)); -struct buf *incore __P((struct vnode *, daddr_t)); u_int minphys __P((struct buf *bp)); +void vwakeup __P((struct buf *bp)); +void brelvp __P((struct buf *bp)); +void bgetvp __P((struct vnode *vp,struct buf *bp)); +void reassignbuf __P((struct buf *bp,struct vnode *newvp)); __END_DECLS #endif #endif /* !_SYS_BUF_H_ */ diff --git a/sys/sys/buf.h b/sys/sys/buf.h index 7072545446d..59738f2f8be 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)buf.h 8.7 (Berkeley) 1/21/94 - * $Id: buf.h,v 1.5 1994/08/06 09:15:33 davidg Exp $ + * $Id: buf.h,v 1.6 1994/08/18 22:35:40 wollman Exp $ */ #ifndef _SYS_BUF_H_ @@ -187,27 +187,33 @@ extern TAILQ_HEAD(swqueue, buf) bswlist; extern struct buf *bclnlist; /* Head of cleaned page list. */ __BEGIN_DECLS -void allocbuf __P((struct buf *, int)); -void bawrite __P((struct buf *)); -void bdwrite __P((struct buf *)); -void biodone __P((struct buf *)); -int biowait __P((struct buf *)); +void bufinit __P((void)); +void bremfree __P((struct buf *)); int bread __P((struct vnode *, daddr_t, int, struct ucred *, struct buf **)); int breadn __P((struct vnode *, daddr_t, int, daddr_t *, int *, int, struct ucred *, struct buf **)); -void brelse __P((struct buf *)); -void bufinit __P((void)); int bwrite __P((struct buf *)); +void bdwrite __P((struct buf *)); +void bawrite __P((struct buf *)); +void brelse __P((struct buf *)); +struct buf *getnewbuf __P((int slpflag, int slptimeo)); +struct buf *incore __P((struct vnode *, daddr_t)); +struct buf *getblk __P((struct vnode *, daddr_t, int, int, int)); +struct buf *geteblk __P((int)); +void allocbuf __P((struct buf *, int)); +int biowait __P((struct buf *)); +void biodone __P((struct buf *)); + void cluster_callback __P((struct buf *)); int cluster_read __P((struct vnode *, u_quad_t, daddr_t, long, struct ucred *, struct buf **)); void cluster_write __P((struct buf *, u_quad_t)); -struct buf *getblk __P((struct vnode *, daddr_t, int, int, int)); -struct buf *geteblk __P((int)); -struct buf *getnewbuf __P((int slpflag, int slptimeo)); -struct buf *incore __P((struct vnode *, daddr_t)); u_int minphys __P((struct buf *bp)); +void vwakeup __P((struct buf *bp)); +void brelvp __P((struct buf *bp)); +void bgetvp __P((struct vnode *vp,struct buf *bp)); +void reassignbuf __P((struct buf *bp,struct vnode *newvp)); __END_DECLS #endif #endif /* !_SYS_BUF_H_ */ diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h index 463e2e44282..02a6eaeb899 100644 --- a/sys/sys/signalvar.h +++ b/sys/sys/signalvar.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)signalvar.h 8.3 (Berkeley) 1/4/94 - * $Id$ + * $Id: signalvar.h,v 1.2 1994/08/02 07:53:33 davidg Exp $ */ #ifndef _SYS_SIGNALVAR_H_ /* tmp for user.h */ @@ -80,8 +80,8 @@ struct sigacts { */ #define CURSIG(p) \ (((p)->p_siglist == 0 || \ - ((p)->p_flag & P_TRACED) == 0 && \ - ((p)->p_siglist & ~(p)->p_sigmask) == 0) ? \ + (((p)->p_flag & P_TRACED) == 0 && \ + ((p)->p_siglist & ~(p)->p_sigmask) == 0)) ? \ 0 : issignal(p)) /* diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index a04560795ce..1958bfb8cf2 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 - * $Id: vnode.h,v 1.7 1994/09/21 03:47:34 wollman Exp $ + * $Id: vnode.h,v 1.8 1994/09/22 22:10:49 wollman Exp $ */ #ifndef _SYS_VNODE_H_ @@ -385,6 +385,7 @@ void cache_enter __P((struct vnode *dvp, struct vnode *vp, int cache_lookup __P((struct vnode *dvp, struct vnode **vpp, struct componentname *cnp)); void cache_purge __P((struct vnode *vp)); +void cache_purgevfs __P((struct mount *mp)); int getnewvnode __P((enum vtagtype tag, struct mount *mp, int (**vops)(), struct vnode **vpp)); int vinvalbuf __P((struct vnode *vp, int save, struct ucred *cred, -- 2.45.2