convert VOP_UNLOCK and vrele into vput's; add proc parameter to union_dircache
[unix-history] / usr / src / sys / kern / kern_subr.c
index 3a904ae..531d00c 100644 (file)
@@ -1,10 +1,15 @@
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
 /*
  * Copyright (c) 1982, 1986, 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)kern_subr.c 8.2 (Berkeley) %G%
+ *     @(#)kern_subr.c 8.4 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -13,6 +18,7 @@
 #include <sys/malloc.h>
 #include <sys/queue.h>
 
 #include <sys/malloc.h>
 #include <sys/queue.h>
 
+int
 uiomove(cp, n, uio)
        register caddr_t cp;
        register int n;
 uiomove(cp, n, uio)
        register caddr_t cp;
        register int n;
@@ -70,17 +76,20 @@ uiomove(cp, n, uio)
 /*
  * Give next character to user as result of read.
  */
 /*
  * Give next character to user as result of read.
  */
+int
 ureadc(c, uio)
        register int c;
        register struct uio *uio;
 {
        register struct iovec *iov;
 
 ureadc(c, uio)
        register int c;
        register struct uio *uio;
 {
        register struct iovec *iov;
 
+       if (uio->uio_resid <= 0)
+               panic("ureadc: non-positive resid");
 again:
 again:
-       if (uio->uio_iovcnt == 0 || uio->uio_resid == 0)
-               panic("ureadc");
+       if (uio->uio_iovcnt <= 0)
+               panic("ureadc: non-positive iovcnt");
        iov = uio->uio_iov;
        iov = uio->uio_iov;
-       if (iov->iov_len == 0) {
+       if (iov->iov_len <= 0) {
                uio->uio_iovcnt--;
                uio->uio_iov++;
                goto again;
                uio->uio_iovcnt--;
                uio->uio_iov++;
                goto again;
@@ -112,6 +121,7 @@ again:
 /*
  * Get next character written in by user from uio.
  */
 /*
  * Get next character written in by user from uio.
  */
+int
 uwritec(uio)
        struct uio *uio;
 {
 uwritec(uio)
        struct uio *uio;
 {
@@ -122,7 +132,7 @@ uwritec(uio)
                return (-1);
 again:
        if (uio->uio_iovcnt <= 0)
                return (-1);
 again:
        if (uio->uio_iovcnt <= 0)
-               panic("uwritec");
+               panic("uwritec: non-positive iovcnt");
        iov = uio->uio_iov;
        if (iov->iov_len == 0) {
                uio->uio_iov++;
        iov = uio->uio_iov;
        if (iov->iov_len == 0) {
                uio->uio_iov++;