This is Garrett Wollmans prototype/ansification of the nfs code,
authorRod Grimes <rgrimes@FreeBSD.org>
Thu, 9 Sep 1993 22:06:29 +0000 (22:06 +0000)
committerRod Grimes <rgrimes@FreeBSD.org>
Thu, 9 Sep 1993 22:06:29 +0000 (22:06 +0000)
it also fixes the nfs cache so that it is dynamically allocated after
boot (saves 21K in kernel load size!)

Removed all patch kit headers, added $Id$'s

20 files changed:
sys/nfs/nfs.h
sys/nfs/nfs_bio.c
sys/nfs/nfs_node.c
sys/nfs/nfs_serv.c
sys/nfs/nfs_socket.c
sys/nfs/nfs_srvcache.c
sys/nfs/nfs_subs.c
sys/nfs/nfs_syscalls.c
sys/nfs/nfs_vfsops.c
sys/nfs/nfs_vnops.c
sys/nfs/nfscompress.h
sys/nfs/nfsdiskless.h
sys/nfs/nfsiom.h
sys/nfs/nfsm_subs.h
sys/nfs/nfsmount.h
sys/nfs/nfsnode.h
sys/nfs/nfsrvcache.h
sys/nfs/nfsv2.h
sys/nfs/rpcv2.h
sys/nfs/xdr_subs.h

index 2be9d4b..4078c46 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs.h       7.11 (Berkeley) 4/19/91
+ *     From:   @(#)nfs.h       7.11 (Berkeley) 4/19/91
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfs
+#define __h_nfs 1
+
 /*
  * Tunable constants for nfs
  */
 /*
  * Tunable constants for nfs
  */
@@ -162,3 +166,5 @@ struct nfsstats {
 #ifdef KERNEL
 struct nfsstats nfsstats;
 #endif /* KERNEL */
 #ifdef KERNEL
 struct nfsstats nfsstats;
 #endif /* KERNEL */
+
+#endif /* __h_nfs */
index a1df3c5..89862b7 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_bio.c   7.19 (Berkeley) 4/16/91
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00147
- * --------------------         -----   ----------------------
- *
- * 20 Apr 93   Paul Kranenburg         Detect and prevent kernel deadlocks in
- *                                     VM system
+ *     From:   @(#)nfs_bio.c   7.19 (Berkeley) 4/16/91
+ *     $Id$
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -54,6 +47,9 @@
 #include "trace.h"
 #include "mount.h"
 #include "resourcevar.h"
 #include "trace.h"
 #include "mount.h"
 #include "resourcevar.h"
+#ifdef PROTOTYPESDONE
+#include "vm/vnode_pager.h"
+#endif /*PROTOTYPESDONE*/
 
 #include "nfsnode.h"
 #include "nfsv2.h"
 
 #include "nfsnode.h"
 #include "nfsv2.h"
@@ -69,6 +65,7 @@
  * Vnode op for read using bio
  * Any similarity to readip() is purely coincidental
  */
  * Vnode op for read using bio
  * Any similarity to readip() is purely coincidental
  */
+int
 nfs_bioread(vp, uio, ioflag, cred)
        register struct vnode *vp;
        register struct uio *uio;
 nfs_bioread(vp, uio, ioflag, cred)
        register struct vnode *vp;
        register struct uio *uio;
@@ -81,7 +78,7 @@ nfs_bioread(vp, uio, ioflag, cred)
        struct vattr vattr;
        daddr_t lbn, bn, rablock;
        int diff, error = 0;
        struct vattr vattr;
        daddr_t lbn, bn, rablock;
        int diff, error = 0;
-       long n, on;
+       long n = 0, on = 0;
 
 #ifdef lint
        ioflag = ioflag;
 
 #ifdef lint
        ioflag = ioflag;
@@ -167,6 +164,8 @@ nfs_bioread(vp, uio, ioflag, cred)
                error = bread(vp, uio->uio_offset, NFS_DIRBLKSIZ, cred, &bp);
                n = MIN(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid);
                break;
                error = bread(vp, uio->uio_offset, NFS_DIRBLKSIZ, cred, &bp);
                n = MIN(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid);
                break;
+            default:
+               ;
            };
            if (error) {
                brelse(bp);
            };
            if (error) {
                brelse(bp);
@@ -185,6 +184,8 @@ nfs_bioread(vp, uio, ioflag, cred)
            case VDIR:
                uio->uio_offset = bp->b_blkno;
                break;
            case VDIR:
                uio->uio_offset = bp->b_blkno;
                break;
+            default:
+               ;
            };
            brelse(bp);
        } while (error == 0 && uio->uio_resid > 0 && n != 0);
            };
            brelse(bp);
        } while (error == 0 && uio->uio_resid > 0 && n != 0);
@@ -194,6 +195,7 @@ nfs_bioread(vp, uio, ioflag, cred)
 /*
  * Vnode op for write using bio
  */
 /*
  * Vnode op for write using bio
  */
+int
 nfs_write(vp, uio, ioflag, cred)
        register struct vnode *vp;
        register struct uio *uio;
 nfs_write(vp, uio, ioflag, cred)
        register struct vnode *vp;
        register struct uio *uio;
index 810378e..d46f7d0 100644 (file)
@@ -33,7 +33,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_node.c  7.34 (Berkeley) 5/15/91
+ *     From:   @(#)nfs_node.c  7.34 (Berkeley) 5/15/91
+ *     $Id$
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -72,6 +73,7 @@ union nhead {
  * Initialize hash links for nfsnodes
  * and build nfsnode free list.
  */
  * Initialize hash links for nfsnodes
  * and build nfsnode free list.
  */
+void
 nfs_nhinit()
 {
        register int i;
 nfs_nhinit()
 {
        register int i;
@@ -111,6 +113,7 @@ nfs_hash(fhp)
  * In all cases, a pointer to a
  * nfsnode structure is returned.
  */
  * In all cases, a pointer to a
  * nfsnode structure is returned.
  */
+int
 nfs_nget(mntp, fhp, npp)
        struct mount *mntp;
        register nfsv2fh_t *fhp;
 nfs_nget(mntp, fhp, npp)
        struct mount *mntp;
        register nfsv2fh_t *fhp;
@@ -163,6 +166,7 @@ loop:
        return (0);
 }
 
        return (0);
 }
 
+int
 nfs_inactive(vp, p)
        struct vnode *vp;
        struct proc *p;
 nfs_inactive(vp, p)
        struct vnode *vp;
        struct proc *p;
@@ -219,6 +223,7 @@ nfs_inactive(vp, p)
 /*
  * Reclaim an nfsnode so that it can be used for other purposes.
  */
 /*
  * Reclaim an nfsnode so that it can be used for other purposes.
  */
+int
 nfs_reclaim(vp)
        register struct vnode *vp;
 {
 nfs_reclaim(vp)
        register struct vnode *vp;
 {
@@ -247,7 +252,7 @@ int donfslocking = 0;
 /*
  * Lock an nfsnode
  */
 /*
  * Lock an nfsnode
  */
-
+int
 nfs_lock(vp)
        struct vnode *vp;
 {
 nfs_lock(vp)
        struct vnode *vp;
 {
@@ -265,11 +270,13 @@ nfs_lock(vp)
        np->n_lockwaiter = 0;
        np->n_lockholder = curproc->p_pid;
        np->n_flag |= NLOCKED;
        np->n_lockwaiter = 0;
        np->n_lockholder = curproc->p_pid;
        np->n_flag |= NLOCKED;
+       return(0);
 }
 
 /*
  * Unlock an nfsnode
  */
 }
 
 /*
  * Unlock an nfsnode
  */
+int
 nfs_unlock(vp)
        struct vnode *vp;
 {
 nfs_unlock(vp)
        struct vnode *vp;
 {
@@ -281,11 +288,13 @@ nfs_unlock(vp)
                np->n_flag &= ~NWANT;
                wakeup((caddr_t)np);
        }
                np->n_flag &= ~NWANT;
                wakeup((caddr_t)np);
        }
+       return(0);
 }
 
 /*
  * Check for a locked nfsnode
  */
 }
 
 /*
  * Check for a locked nfsnode
  */
+int
 nfs_islocked(vp)
        struct vnode *vp;
 {
 nfs_islocked(vp)
        struct vnode *vp;
 {
@@ -300,6 +309,7 @@ nfs_islocked(vp)
  * since I can't decide if dirs. should be locked, I will check for
  * the lock and be flexible
  */
  * since I can't decide if dirs. should be locked, I will check for
  * the lock and be flexible
  */
+void
 nfs_nput(vp)
        struct vnode *vp;
 {
 nfs_nput(vp)
        struct vnode *vp;
 {
@@ -315,6 +325,7 @@ nfs_nput(vp)
  * done. Currently nothing to do.
  */
 /* ARGSUSED */
  * done. Currently nothing to do.
  */
 /* ARGSUSED */
+int
 nfs_abortop(ndp)
        struct nameidata *ndp;
 {
 nfs_abortop(ndp)
        struct nameidata *ndp;
 {
index 00a2097..9279604 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_serv.c  7.40 (Berkeley) 5/15/91
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         3       00090
- * --------------------         -----   ----------------------
- *
- * 08 Sep 92   Rick "gopher I"         Fix "truncate" (conflicting?)
- * 28 Aug 92   Arne Henrik Juul        Fixed NFS "create" bug
- * 02 Mar 92   Greg Hackney            Make NFS POSIX compliant (anon fix)
+ *     From:   @(#)nfs_serv.c  7.40 (Berkeley) 5/15/91
+ *     $Id$
  */
 
 /*
  */
 
 /*
@@ -95,6 +87,7 @@ nfstype nfs_type[9]={ NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON,
 /*
  * nfs getattr service
  */
 /*
  * nfs getattr service
  */
+int
 nfsrv_getattr(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_getattr(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -132,6 +125,7 @@ nfsrv_getattr(mrep, md, dpos, cred, xid, mrq, repstat, p)
 /*
  * nfs setattr service
  */
 /*
  * nfs setattr service
  */
+int
 nfsrv_setattr(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_setattr(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -207,6 +201,7 @@ out:
 /*
  * nfs lookup rpc
  */
 /*
  * nfs lookup rpc
  */
+int
 nfsrv_lookup(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_lookup(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -257,6 +252,7 @@ nfsrv_lookup(mrep, md, dpos, cred, xid, mrq, repstat, p)
 /*
  * nfs readlink service
  */
 /*
  * nfs readlink service
  */
+int
 nfsrv_readlink(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_readlink(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -340,6 +336,7 @@ out:
 /*
  * nfs read service
  */
 /*
  * nfs read service
  */
+int
 nfsrv_read(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_read(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -450,6 +447,7 @@ nfsrv_read(mrep, md, dpos, cred, xid, mrq, repstat, p)
 /*
  * nfs write service
  */
 /*
  * nfs write service
  */
+int
 nfsrv_write(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_write(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -564,6 +562,7 @@ nfsrv_write(mrep, md, dpos, cred, xid, mrq, repstat, p)
  * if it already exists, just set length               * 28 Aug 92*
  * do NOT truncate unconditionally !
  */
  * if it already exists, just set length               * 28 Aug 92*
  * do NOT truncate unconditionally !
  */
+int
 nfsrv_create(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_create(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -626,7 +625,7 @@ nfsrv_create(mrep, md, dpos, cred, xid, mrq, repstat, p)
                                error = ENXIO;
                                goto out;
 #endif /* FIFO */
                                error = ENXIO;
                                goto out;
 #endif /* FIFO */
-                       } else if (error = suser(cred, (short *)0)) {
+                       } else if (error = suser(cred, (u_short *)0)) {
                                VOP_ABORTOP(&nd);
                                vput(nd.ni_dvp);
                                goto out;
                                VOP_ABORTOP(&nd);
                                vput(nd.ni_dvp);
                                goto out;
@@ -701,11 +700,13 @@ out:
        vrele(nd.ni_startdir);
        free(nd.ni_pnbuf, M_NAMEI);
        nfsm_reply(0);
        vrele(nd.ni_startdir);
        free(nd.ni_pnbuf, M_NAMEI);
        nfsm_reply(0);
+       return 0;
 }
 
 /*
  * nfs remove service
  */
 }
 
 /*
  * nfs remove service
  */
+int
 nfsrv_remove(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_remove(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -735,7 +736,7 @@ nfsrv_remove(mrep, md, dpos, cred, xid, mrq, repstat, p)
                nfsm_reply(0);
        vp = nd.ni_vp;
        if (vp->v_type == VDIR &&
                nfsm_reply(0);
        vp = nd.ni_vp;
        if (vp->v_type == VDIR &&
-               (error = suser(cred, (short *)0)))
+               (error = suser(cred, (u_short *)0)))
                goto out;
        /*
         * The root of a mounted filesystem cannot be deleted.
                goto out;
        /*
         * The root of a mounted filesystem cannot be deleted.
@@ -764,6 +765,7 @@ out:
 /*
  * nfs rename service
  */
 /*
  * nfs rename service
  */
+int
 nfsrv_rename(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_rename(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -882,6 +884,7 @@ nfsmout:
 /*
  * nfs link service
  */
 /*
  * nfs link service
  */
+int
 nfsrv_link(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_link(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -944,6 +947,7 @@ out1:
 /*
  * nfs symbolic link service
  */
 /*
  * nfs symbolic link service
  */
+int
 nfsrv_symlink(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_symlink(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -1024,6 +1028,7 @@ nfsmout:
 /*
  * nfs mkdir service
  */
 /*
  * nfs mkdir service
  */
+int
 nfsrv_mkdir(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_mkdir(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -1100,6 +1105,7 @@ nfsmout:
 /*
  * nfs rmdir service
  */
 /*
  * nfs rmdir service
  */
+int
 nfsrv_rmdir(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
 nfsrv_rmdir(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf *mrep, *md, **mrq;
        caddr_t dpos;
@@ -1187,6 +1193,7 @@ out:
  *     to including the status longwords that are not a part of the dir.
  *     "entry" structures, but are in the rpc.
  */
  *     to including the status longwords that are not a part of the dir.
  *     "entry" structures, but are in the rpc.
  */
+int
 nfsrv_readdir(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_readdir(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -1376,6 +1383,7 @@ again:
 /*
  * nfs statfs service
  */
 /*
  * nfs statfs service
  */
+int
 nfsrv_statfs(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_statfs(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -1419,6 +1427,7 @@ nfsrv_statfs(mrep, md, dpos, cred, xid, mrq, repstat, p)
  * Null operation, used by clients to ping server
  */
 /* ARGSUSED */
  * Null operation, used by clients to ping server
  */
 /* ARGSUSED */
+int
 nfsrv_null(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_null(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -1441,6 +1450,7 @@ nfsrv_null(mrep, md, dpos, cred, xid, mrq, repstat, p)
  * No operation, used for obsolete procedures
  */
 /* ARGSUSED */
  * No operation, used for obsolete procedures
  */
 /* ARGSUSED */
+int
 nfsrv_noop(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
 nfsrv_noop(mrep, md, dpos, cred, xid, mrq, repstat, p)
        struct mbuf **mrq;
        struct mbuf *mrep, *md;
@@ -1472,6 +1482,7 @@ nfsrv_noop(mrep, md, dpos, cred, xid, mrq, repstat, p)
  *     this because it opens a security hole, but since the nfs server opens
  *     a security hole the size of a barn door anyhow, what the heck.
  */
  *     this because it opens a security hole, but since the nfs server opens
  *     a security hole the size of a barn door anyhow, what the heck.
  */
+int
 nfsrv_access(vp, flags, cred, p)
        register struct vnode *vp;
        int flags;
 nfsrv_access(vp, flags, cred, p)
        register struct vnode *vp;
        int flags;
@@ -1491,6 +1502,8 @@ nfsrv_access(vp, flags, cred, p)
                        switch (vp->v_type) {
                        case VREG: case VDIR: case VLNK:
                                return (EROFS);
                        switch (vp->v_type) {
                        case VREG: case VDIR: case VLNK:
                                return (EROFS);
+                             default:
+                               ;
                        }
                }
                /*
                        }
                }
                /*
index ebd1282..cf23d4a 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_socket.c        7.23 (Berkeley) 4/20/91
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00053
- * --------------------         -----   ----------------------
- *
- * 08 Sep 92    Rick "gopher I"         Fix "reserved port" bug, fixed for
- *                                             AIX3.2 NFS clients
+ *     From:   @(#)nfs_socket.c        7.23 (Berkeley) 4/20/91
+ *     $Id$
  */
 
 /*
  */
 
 /*
@@ -155,6 +148,7 @@ int nfs_tcpnodelay = 1;
  * Initialize sockets and congestion for a new NFS connection.
  * We do not free the sockaddr if error.
  */
  * Initialize sockets and congestion for a new NFS connection.
  * We do not free the sockaddr if error.
  */
+int
 nfs_connect(nmp)
        register struct nfsmount *nmp;
 {
 nfs_connect(nmp)
        register struct nfsmount *nmp;
 {
@@ -285,6 +279,7 @@ bad:
  * If this fails the mount point is DEAD!
  * nb: Must be called with the nfs_solock() set on the mount point.
  */
  * If this fails the mount point is DEAD!
  * nb: Must be called with the nfs_solock() set on the mount point.
  */
+int
 nfs_reconnect(rep, nmp)
        register struct nfsreq *rep;
        register struct nfsmount *nmp;
 nfs_reconnect(rep, nmp)
        register struct nfsreq *rep;
        register struct nfsmount *nmp;
@@ -340,6 +335,7 @@ nfs_disconnect(nmp)
  * must be called with an nfs_solock() on the socket.
  * "rep == NULL" indicates that it has been called from a server.
  */
  * must be called with an nfs_solock() on the socket.
  * "rep == NULL" indicates that it has been called from a server.
  */
+int
 nfs_send(so, nam, top, rep)
        register struct socket *so;
        struct mbuf *nam;
 nfs_send(so, nam, top, rep)
        register struct socket *so;
        struct mbuf *nam;
@@ -394,6 +390,7 @@ nfs_send(so, nam, top, rep)
  * For SOCK_STREAM we must be very careful to read an entire record once
  * we have read any of it, even if the system call has been interrupted.
  */
  * For SOCK_STREAM we must be very careful to read an entire record once
  * we have read any of it, even if the system call has been interrupted.
  */
+int
 nfs_receive(so, aname, mp, rep)
        register struct socket *so;
        struct mbuf **aname;
 nfs_receive(so, aname, mp, rep)
        register struct socket *so;
        struct mbuf **aname;
@@ -403,8 +400,8 @@ nfs_receive(so, aname, mp, rep)
        struct uio auio;
        struct iovec aio;
        register struct mbuf *m;
        struct uio auio;
        struct iovec aio;
        register struct mbuf *m;
-       struct mbuf *m2, *mnew, **mbp;
-       caddr_t fcp, tcp;
+       struct mbuf *m2 = 0, *mnew, **mbp;
+       caddr_t fcp, tcp = 0;
        u_long len;
        struct mbuf **getnam;
        int error, siz, mlen, soflags, rcvflg;
        u_long len;
        struct mbuf **getnam;
        int error, siz, mlen, soflags, rcvflg;
@@ -616,6 +613,7 @@ errout:
  * with outstanding requests using the xid, until ours is found.
  */
 /* ARGSUSED */
  * with outstanding requests using the xid, until ours is found.
  */
 /* ARGSUSED */
+int
 nfs_reply(nmp, myrep)
        struct nfsmount *nmp;
        struct nfsreq *myrep;
 nfs_reply(nmp, myrep)
        struct nfsmount *nmp;
        struct nfsreq *myrep;
@@ -625,8 +623,8 @@ nfs_reply(nmp, myrep)
        register int error = 0;
        u_long rxid;
        struct mbuf *mp, *nam;
        register int error = 0;
        u_long rxid;
        struct mbuf *mp, *nam;
-       char *cp;
-       int cnt, xfer;
+/*     char *cp; */
+/*     int cnt, xfer; */
 
        /*
         * Loop around until we get our own reply
 
        /*
         * Loop around until we get our own reply
@@ -736,6 +734,7 @@ nfs_reply(nmp, myrep)
  *       by mrep or error
  * nb: always frees up mreq mbuf list
  */
  *       by mrep or error
  * nb: always frees up mreq mbuf list
  */
+int
 nfs_request(vp, mreq, xid, procnum, procp, tryhard, mp, mrp, mdp, dposp)
        struct vnode *vp;
        struct mbuf *mreq;
 nfs_request(vp, mreq, xid, procnum, procp, tryhard, mp, mrp, mdp, dposp)
        struct vnode *vp;
        struct mbuf *mreq;
@@ -932,6 +931,7 @@ nfsmout:
  * - verify it
  * - fill in the cred struct.
  */
  * - verify it
  * - fill in the cred struct.
  */
+int
 nfs_getreq(so, prog, vers, maxproc, nam, mrp, mdp, dposp, retxid, procnum, cr,
        msk, mtch, wascomp, repstat)                            /* 08 Aug 92*/
        struct socket *so;
 nfs_getreq(so, prog, vers, maxproc, nam, mrp, mdp, dposp, retxid, procnum, cr,
        msk, mtch, wascomp, repstat)                            /* 08 Aug 92*/
        struct socket *so;
@@ -1061,6 +1061,7 @@ nfsmout:
  * Generate the rpc reply header
  * siz arg. is used to decide if adding a cluster is worthwhile
  */
  * Generate the rpc reply header
  * siz arg. is used to decide if adding a cluster is worthwhile
  */
+int
 nfs_rephead(siz, retxid, err, mrq, mbp, bposp)
        int siz;
        u_long retxid;
 nfs_rephead(siz, retxid, err, mrq, mbp, bposp)
        int siz;
        u_long retxid;
@@ -1128,7 +1129,9 @@ nfs_rephead(siz, retxid, err, mrq, mbp, bposp)
  * To avoid retransmission attempts on STREAM sockets (in the future) make
  * sure to set the r_retry field to 0 (implies nm_retry == 0).
  */
  * To avoid retransmission attempts on STREAM sockets (in the future) make
  * sure to set the r_retry field to 0 (implies nm_retry == 0).
  */
-nfs_timer()
+void
+nfs_timer(arg)
+     caddr_t arg;
 {
        register struct nfsreq *rep;
        register struct mbuf *m;
 {
        register struct nfsreq *rep;
        register struct mbuf *m;
@@ -1197,7 +1200,8 @@ nfs_timer()
                        nfsstats.rpcretries++;
                        if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
                            error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
                        nfsstats.rpcretries++;
                        if ((nmp->nm_flag & NFSMNT_NOCONN) == 0)
                            error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
-                           (caddr_t)0, (struct mbuf *)0, (struct mbuf *)0);
+                           (struct mbuf *)0, (struct mbuf *)0,
+                           (struct mbuf *)0);
                        else
                            error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
                            nmp->nm_nam, (struct mbuf *)0, (struct mbuf *)0);
                        else
                            error = (*so->so_proto->pr_usrreq)(so, PRU_SEND, m,
                            nmp->nm_nam, (struct mbuf *)0, (struct mbuf *)0);
@@ -1257,6 +1261,7 @@ nfs_timer()
  */
 #define NFS_RTO(nmp)   (((nmp)->nm_srtt >> 3) + (nmp)->nm_rttvar)
 
  */
 #define NFS_RTO(nmp)   (((nmp)->nm_srtt >> 3) + (nmp)->nm_rttvar)
 
+void
 nfs_updatetimer(nmp)
        register struct nfsmount *nmp;
 {
 nfs_updatetimer(nmp)
        register struct nfsmount *nmp;
 {
@@ -1305,6 +1310,7 @@ nfs_updatetimer(nmp)
                nmp->nm_window = NFS_MAXWINDOW;
 }
 
                nmp->nm_window = NFS_MAXWINDOW;
 }
 
+void
 nfs_backofftimer(nmp)
        register struct nfsmount *nmp;
 {
 nfs_backofftimer(nmp)
        register struct nfsmount *nmp;
 {
@@ -1340,6 +1346,7 @@ nfs_backofftimer(nmp)
  * Test for a termination signal pending on procp.
  * This is used for NFSMNT_INT mounts.
  */
  * Test for a termination signal pending on procp.
  * This is used for NFSMNT_INT mounts.
  */
+int
 nfs_sigintr(p)
        register struct proc *p;
 {
 nfs_sigintr(p)
        register struct proc *p;
 {
@@ -1350,9 +1357,10 @@ nfs_sigintr(p)
                return (0);
 }
 
                return (0);
 }
 
+void
 nfs_msg(p, server, msg)
        struct proc *p;
 nfs_msg(p, server, msg)
        struct proc *p;
-       char *server, *msg;
+       const char *server, *msg;
 {
        tpr_t tpr;
 
 {
        tpr_t tpr;
 
@@ -1370,6 +1378,7 @@ nfs_msg(p, server, msg)
  * and also to avoid race conditions between the processes with nfs requests
  * in progress when a reconnect is necessary.
  */
  * and also to avoid race conditions between the processes with nfs requests
  * in progress when a reconnect is necessary.
  */
+void
 nfs_solock(flagp)
        register int *flagp;
 {
 nfs_solock(flagp)
        register int *flagp;
 {
@@ -1384,6 +1393,7 @@ nfs_solock(flagp)
 /*
  * Unlock the stream socket for others.
  */
 /*
  * Unlock the stream socket for others.
  */
+void
 nfs_sounlock(flagp)
        register int *flagp;
 {
 nfs_sounlock(flagp)
        register int *flagp;
 {
@@ -1402,6 +1412,7 @@ nfs_sounlock(flagp)
  * if they are the same.
  * If there is any doubt, return FALSE.
  */
  * if they are the same.
  * If there is any doubt, return FALSE.
  */
+int
 nfs_netaddr_match(nam1, nam2)
        struct mbuf *nam1, *nam2;
 {
 nfs_netaddr_match(nam1, nam2)
        struct mbuf *nam1, *nam2;
 {
@@ -1435,6 +1446,7 @@ nfs_netaddr_match(nam1, nam2)
  * - Compare for == with match
  * return TRUE if not equal
  */
  * - Compare for == with match
  * return TRUE if not equal
  */
+int
 nfs_badnam(nam, msk, mtch)
        register struct mbuf *nam, *msk, *mtch;
 {
 nfs_badnam(nam, msk, mtch)
        register struct mbuf *nam, *msk, *mtch;
 {
index b274b17..802ca50 100644 (file)
@@ -33,7 +33,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_srvcache.c      7.11 (Berkeley) 4/16/91
+ *     From:   @(#)nfs_srvcache.c      7.11 (Berkeley) 4/16/91
+ *     $Id$
  */
 
 /*
  */
 
 /*
@@ -71,7 +72,8 @@ union rhead {
 } rhead[NFSRCHSZ];
 
 static struct nfsrvcache nfsrvcachehead;
 } rhead[NFSRCHSZ];
 
 static struct nfsrvcache nfsrvcachehead;
-static struct nfsrvcache nfsrvcache[NFSRVCACHESIZ];
+/* static struct nfsrvcache nfsrvcache[NFSRVCACHESIZ]; */
+static struct nfsrvcache *nfsrvcache;
 
 #define TRUE   1
 #define        FALSE   0
 
 #define TRUE   1
 #define        FALSE   0
@@ -125,13 +127,18 @@ static int repliesstatus[NFS_NPROCS] = {
 /*
  * Initialize the server request cache list
  */
 /*
  * Initialize the server request cache list
  */
+void
 nfsrv_initcache()
 {
        register int i;
 nfsrv_initcache()
 {
        register int i;
-       register struct nfsrvcache *rp = nfsrvcache;
+       register struct nfsrvcache *rp;
        register struct nfsrvcache *hp = &nfsrvcachehead;
        register union  rhead *rh = rhead;
 
        register struct nfsrvcache *hp = &nfsrvcachehead;
        register union  rhead *rh = rhead;
 
+       MALLOC(nfsrvcache, struct nfsrvcache *,
+              NFSRVCACHESIZ * sizeof *nfsrvcache, M_CACHE, M_WAITOK);
+       rp = nfsrvcache;
+
        for (i = NFSRCHSZ; --i >= 0; rh++) {
                rh->rh_head[0] = rh;
                rh->rh_head[1] = rh;
        for (i = NFSRCHSZ; --i >= 0; rh++) {
                rh->rh_head[0] = rh;
                rh->rh_head[1] = rh;
@@ -164,6 +171,7 @@ nfsrv_initcache()
  *   return DOIT
  * Update/add new request at end of lru list
  */
  *   return DOIT
  * Update/add new request at end of lru list
  */
+int
 nfsrv_getcache(nam, xid, proc, repp)
        struct mbuf *nam;
        u_long xid;
 nfsrv_getcache(nam, xid, proc, repp)
        struct mbuf *nam;
        u_long xid;
@@ -176,6 +184,8 @@ nfsrv_getcache(nam, xid, proc, repp)
        caddr_t bpos;
        int ret;
 
        caddr_t bpos;
        int ret;
 
+       if(!nfsrvcache) nfsrv_initcache();
+
        rh = &rhead[NFSRCHASH(xid)];
 loop:
        for (rp = rh->rh_chain[0]; rp != (struct nfsrvcache *)rh; rp = rp->rc_forw) {
        rh = &rhead[NFSRCHASH(xid)];
 loop:
        for (rp = rh->rh_chain[0]; rp != (struct nfsrvcache *)rh; rp = rp->rc_forw) {
@@ -245,6 +255,7 @@ loop:
 /*
  * Update a request cache entry after the rpc has been done
  */
 /*
  * Update a request cache entry after the rpc has been done
  */
+void
 nfsrv_updatecache(nam, xid, proc, repvalid, repstat, repmbuf)
        struct mbuf *nam;
        u_long xid;
 nfsrv_updatecache(nam, xid, proc, repvalid, repstat, repmbuf)
        struct mbuf *nam;
        u_long xid;
@@ -256,6 +267,8 @@ nfsrv_updatecache(nam, xid, proc, repvalid, repstat, repmbuf)
        register struct nfsrvcache *rp;
        register union  rhead *rh;
 
        register struct nfsrvcache *rp;
        register union  rhead *rh;
 
+       if(!nfsrvcache) nfsrv_initcache();
+
        rh = &rhead[NFSRCHASH(xid)];
 loop:
        for (rp = rh->rh_chain[0]; rp != (struct nfsrvcache *)rh; rp = rp->rc_forw) {
        rh = &rhead[NFSRCHASH(xid)];
 loop:
        for (rp = rh->rh_chain[0]; rp != (struct nfsrvcache *)rh; rp = rp->rc_forw) {
index 86537c6..6d86451 100644 (file)
@@ -33,7 +33,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_subs.c  7.41 (Berkeley) 5/15/91
+ *     From:   @(#)nfs_subs.c  7.41 (Berkeley) 5/15/91
+ *     $Id$
  */
 
 /*
  */
 
 /*
@@ -51,6 +52,9 @@
 #include "vnode.h"
 #include "namei.h"
 #include "mbuf.h"
 #include "vnode.h"
 #include "namei.h"
 #include "mbuf.h"
+#ifdef PROTOTYPESDONE
+#include "vm/vnode_pager.h"
+#endif /*PROTOTYPESDONE*/
 
 #include "../ufs/quota.h"
 #include "../ufs/inode.h"
 
 #include "../ufs/quota.h"
 #include "../ufs/inode.h"
@@ -184,6 +188,7 @@ struct mbuf *nfsm_reqh(prog, vers, procid, cred, hsiz, bpos, mb, retxid)
 /*
  * copies mbuf chain to the uio scatter/gather list
  */
 /*
  * copies mbuf chain to the uio scatter/gather list
  */
+int
 nfsm_mbuftouio(mrep, uiop, siz, dpos)
        struct mbuf **mrep;
        register struct uio *uiop;
 nfsm_mbuftouio(mrep, uiop, siz, dpos)
        struct mbuf **mrep;
        register struct uio *uiop;
@@ -258,6 +263,7 @@ nfsm_mbuftouio(mrep, uiop, siz, dpos)
 /*
  * copies a uio scatter/gather list to an mbuf chain...
  */
 /*
  * copies a uio scatter/gather list to an mbuf chain...
  */
+int
 nfsm_uiotombuf(uiop, mq, siz, bpos)
        register struct uio *uiop;
        struct mbuf **mq;
 nfsm_uiotombuf(uiop, mq, siz, bpos)
        register struct uio *uiop;
        struct mbuf **mq;
@@ -343,6 +349,7 @@ nfsm_uiotombuf(uiop, mq, siz, bpos)
  * This is used by the macros nfsm_disect and nfsm_disecton for tough
  * cases. (The macros use the vars. dpos and dpos2)
  */
  * This is used by the macros nfsm_disect and nfsm_disecton for tough
  * cases. (The macros use the vars. dpos and dpos2)
  */
+int
 nfsm_disct(mdp, dposp, siz, left, updateflg, cp2)
        struct mbuf **mdp;
        caddr_t *dposp;
 nfsm_disct(mdp, dposp, siz, left, updateflg, cp2)
        struct mbuf **mdp;
        caddr_t *dposp;
@@ -411,6 +418,7 @@ nfsm_disct(mdp, dposp, siz, left, updateflg, cp2)
 /*
  * Advance the position in the mbuf chain.
  */
 /*
  * Advance the position in the mbuf chain.
  */
+int
 nfs_adv(mdp, dposp, offs, left)
        struct mbuf **mdp;
        caddr_t *dposp;
 nfs_adv(mdp, dposp, offs, left)
        struct mbuf **mdp;
        caddr_t *dposp;
@@ -437,6 +445,7 @@ nfs_adv(mdp, dposp, offs, left)
 /*
  * Copy a string into mbufs for the hard cases...
  */
 /*
  * Copy a string into mbufs for the hard cases...
  */
+int
 nfsm_strtmbuf(mb, bpos, cp, siz)
        struct mbuf **mb;
        char **bpos;
 nfsm_strtmbuf(mb, bpos, cp, siz)
        struct mbuf **mb;
        char **bpos;
@@ -502,6 +511,7 @@ nfsm_strtmbuf(mb, bpos, cp, siz)
 /*
  * Called once to initialize data structures...
  */
 /*
  * Called once to initialize data structures...
  */
+void
 nfs_init()
 {
        register int i;
 nfs_init()
 {
        register int i;
@@ -596,6 +606,7 @@ static char *nfs_unixauth(cr)
  * Iff vap not NULL
  *    copy the attributes to *vaper
  */
  * Iff vap not NULL
  *    copy the attributes to *vaper
  */
+int
 nfs_loadattrcache(vpp, mdp, dposp, vaper)
        struct vnode **vpp;
        struct mbuf **mdp;
 nfs_loadattrcache(vpp, mdp, dposp, vaper)
        struct vnode **vpp;
        struct mbuf **mdp;
@@ -715,6 +726,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
  * If the cache is valid, copy contents to *vap and return 0
  * otherwise return an error
  */
  * If the cache is valid, copy contents to *vap and return 0
  * otherwise return an error
  */
+int
 nfs_getattrcache(vp, vap)
        register struct vnode *vp;
        struct vattr *vap;
 nfs_getattrcache(vp, vap)
        register struct vnode *vp;
        struct vattr *vap;
@@ -740,6 +752,7 @@ nfs_getattrcache(vp, vap)
 /*
  * Set up nameidata for a namei() call and do it
  */
 /*
  * Set up nameidata for a namei() call and do it
  */
+int
 nfs_namei(ndp, fhp, len, mdp, dposp, p)
        register struct nameidata *ndp;
        fhandle_t *fhp;
 nfs_namei(ndp, fhp, len, mdp, dposp, p)
        register struct nameidata *ndp;
        fhandle_t *fhp;
@@ -847,6 +860,7 @@ out:
  * A fiddled version of m_adj() that ensures null fill to a long
  * boundary and only trims off the back end
  */
  * A fiddled version of m_adj() that ensures null fill to a long
  * boundary and only trims off the back end
  */
+void
 nfsm_adj(mp, len, nul)
        struct mbuf *mp;
        register int len;
 nfsm_adj(mp, len, nul)
        struct mbuf *mp;
        register int len;
@@ -912,6 +926,7 @@ nfsm_adj(mp, len, nul)
  *     - if not lockflag unlock it with VOP_UNLOCK()
  *     - if cred->cr_uid == 0 set it to m_exroot
  */
  *     - if not lockflag unlock it with VOP_UNLOCK()
  *     - if cred->cr_uid == 0 set it to m_exroot
  */
+int
 nfsrv_fhtovp(fhp, lockflag, vpp, cred)
        fhandle_t *fhp;
        int lockflag;
 nfsrv_fhtovp(fhp, lockflag, vpp, cred)
        fhandle_t *fhp;
        int lockflag;
index db7a436..a334b51 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_syscalls.c      7.26 (Berkeley) 4/16/91
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00053
- * --------------------         -----   ----------------------
- *
- * 08 Sep 92    Rick "gopher I"         Fix "reserved port" bug, fixed for
- *                                              AIX3.2 NFS clients
+ *     From:   @(#)nfs_syscalls.c      7.26 (Berkeley) 4/16/91
+ *     $Id$
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -116,6 +109,7 @@ struct getfh_args {
 };
 
 /* ARGSUSED */
 };
 
 /* ARGSUSED */
+int
 getfh(p, uap, retval)
        struct proc *p;
        register struct getfh_args *uap;
 getfh(p, uap, retval)
        struct proc *p;
        register struct getfh_args *uap;
@@ -163,6 +157,7 @@ struct nfssvc_args {
 };
 
 /* ARGSUSED */
 };
 
 /* ARGSUSED */
+int
 nfssvc(p, uap, retval)
        struct proc *p;
        register struct nfssvc_args *uap;
 nfssvc(p, uap, retval)
        struct proc *p;
        register struct nfssvc_args *uap;
@@ -324,6 +319,7 @@ bad:
  * Never returns unless it fails or gets killed
  */
 /* ARGSUSED */
  * Never returns unless it fails or gets killed
  */
 /* ARGSUSED */
+int
 async_daemon(p, uap, retval)
        struct proc *p;
        struct args *uap;
 async_daemon(p, uap, retval)
        struct proc *p;
        struct args *uap;
index d08c12d..d79e856 100644 (file)
@@ -33,7 +33,8 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_vfsops.c        7.31 (Berkeley) 5/6/91
+ *     From:   @(#)nfs_vfsops.c        7.31 (Berkeley) 5/6/91
+ *     $Id$
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -47,6 +48,7 @@
 #include "buf.h"
 #include "mbuf.h"
 #include "socket.h"
 #include "buf.h"
 #include "mbuf.h"
 #include "socket.h"
+#include "socketvar.h"
 #include "systm.h"
 
 #include "../net/if.h"
 #include "systm.h"
 
 #include "../net/if.h"
@@ -89,6 +91,7 @@ void nfs_disconnect();
 /*
  * nfs statfs call
  */
 /*
  * nfs statfs call
  */
+int
 nfs_statfs(mp, sbp, p)
        struct mount *mp;
        register struct statfs *sbp;
 nfs_statfs(mp, sbp, p)
        struct mount *mp;
        register struct statfs *sbp;
@@ -149,13 +152,14 @@ nfs_statfs(mp, sbp, p)
  * - hand craft the swap nfs vnode hanging off a fake mount point
  * - build the rootfs mount point and call mountnfs() to do the rest.
  */
  * - hand craft the swap nfs vnode hanging off a fake mount point
  * - build the rootfs mount point and call mountnfs() to do the rest.
  */
+int
 nfs_mountroot()
 {
        register struct mount *mp;
        register struct mbuf *m;
        struct socket *so;
        struct vnode *vp;
 nfs_mountroot()
 {
        register struct mount *mp;
        register struct mbuf *m;
        struct socket *so;
        struct vnode *vp;
-       int error;
+/*     int error;*/
 
        /*
         * Do enough of ifconfig(8) so that critical net interface can
 
        /*
         * Do enough of ifconfig(8) so that critical net interface can
@@ -163,7 +167,9 @@ nfs_mountroot()
         */
        if (socreate(nfs_diskless.myif.ifra_addr.sa_family, &so, SOCK_DGRAM, 0))
                panic("nfs ifconf");
         */
        if (socreate(nfs_diskless.myif.ifra_addr.sa_family, &so, SOCK_DGRAM, 0))
                panic("nfs ifconf");
-       if (ifioctl(so, SIOCAIFADDR, &nfs_diskless.myif))
+       /* XXX - this probably will crash with a vm_fault, since
+          ifioctl expects to get a valid process pointer */
+       if (ifioctl(so, SIOCAIFADDR, (caddr_t)&nfs_diskless.myif, 0))
                panic("nfs ifconf2");
        soclose(so);
 
                panic("nfs ifconf2");
        soclose(so);
 
@@ -182,8 +188,15 @@ nfs_mountroot()
                bcopy((caddr_t)&nfs_diskless.mygateway, (caddr_t)&rt.rt_gateway,
                        sizeof (struct sockaddr_in));
                rt.rt_flags = (RTF_UP | RTF_GATEWAY);
                bcopy((caddr_t)&nfs_diskless.mygateway, (caddr_t)&rt.rt_gateway,
                        sizeof (struct sockaddr_in));
                rt.rt_flags = (RTF_UP | RTF_GATEWAY);
-               if (rtioctl(SIOCADDRT, (caddr_t)&rt))
-                       panic("nfs root route");
+               {
+                 /* copied over from rtioctl() -GW */
+                 extern struct sockaddr_in icmpmask;
+                 if (rtrequest(RTM_ADD, &rt.rt_dst, &rt.rt_gateway,
+                               (struct sockaddr *)&icmpmask,
+                               RTF_UP | RTF_GATEWAY,
+                               (struct rtentry **)0))
+                   panic("nfs root route");
+               }
        }
 #endif /* COMPAT_43 */
 
        }
 #endif /* COMPAT_43 */
 
@@ -258,7 +271,9 @@ nfs_mountroot()
        mp->mnt_vnodecovered = NULLVP;
        vfs_unlock(mp);
        rootvp = vp;
        mp->mnt_vnodecovered = NULLVP;
        vfs_unlock(mp);
        rootvp = vp;
+#ifndef __386BSD__
        inittodr((time_t)0);    /* There is no time in the nfs fsstat so ?? */
        inittodr((time_t)0);    /* There is no time in the nfs fsstat so ?? */
+#endif
        return (0);
 }
 
        return (0);
 }
 
@@ -272,6 +287,7 @@ nfs_mountroot()
  * an error after that means that I have to release the mbuf.
  */
 /* ARGSUSED */
  * an error after that means that I have to release the mbuf.
  */
 /* ARGSUSED */
+int
 nfs_mount(mp, path, data, ndp, p)
        struct mount *mp;
        char *path;
 nfs_mount(mp, path, data, ndp, p)
        struct mount *mp;
        char *path;
@@ -311,6 +327,7 @@ nfs_mount(mp, path, data, ndp, p)
 /*
  * Common code for mount and mountroot
  */
 /*
  * Common code for mount and mountroot
  */
+int
 mountnfs(argp, mp, nam, pth, hst, vpp)
        register struct nfs_args *argp;
        register struct mount *mp;
 mountnfs(argp, mp, nam, pth, hst, vpp)
        register struct nfs_args *argp;
        register struct mount *mp;
@@ -444,6 +461,7 @@ bad:
 /*
  * unmount system call
  */
 /*
  * unmount system call
  */
+int
 nfs_unmount(mp, mntflags, p)
        struct mount *mp;
        int mntflags;
 nfs_unmount(mp, mntflags, p)
        struct mount *mp;
        int mntflags;
@@ -506,6 +524,7 @@ nfs_unmount(mp, mntflags, p)
 /*
  * Return root of a filesystem
  */
 /*
  * Return root of a filesystem
  */
+int
 nfs_root(mp, vpp)
        struct mount *mp;
        struct vnode **vpp;
 nfs_root(mp, vpp)
        struct mount *mp;
        struct vnode **vpp;
@@ -531,6 +550,7 @@ extern int syncprt;
  * Flush out the buffer cache
  */
 /* ARGSUSED */
  * Flush out the buffer cache
  */
 /* ARGSUSED */
+int
 nfs_sync(mp, waitfor)
        struct mount *mp;
        int waitfor;
 nfs_sync(mp, waitfor)
        struct mount *mp;
        int waitfor;
@@ -548,6 +568,7 @@ nfs_sync(mp, waitfor)
  * At this point, this should never happen
  */
 /* ARGSUSED */
  * At this point, this should never happen
  */
 /* ARGSUSED */
+int
 nfs_fhtovp(mp, fhp, vpp)
        struct mount *mp;
        struct fid *fhp;
 nfs_fhtovp(mp, fhp, vpp)
        struct mount *mp;
        struct fid *fhp;
@@ -561,6 +582,7 @@ nfs_fhtovp(mp, fhp, vpp)
  * Vnode pointer to File handle, should never happen either
  */
 /* ARGSUSED */
  * Vnode pointer to File handle, should never happen either
  */
 /* ARGSUSED */
+int
 nfs_vptofh(vp, fhp)
        struct vnode *vp;
        struct fid *fhp;
 nfs_vptofh(vp, fhp)
        struct vnode *vp;
        struct fid *fhp;
@@ -573,6 +595,7 @@ nfs_vptofh(vp, fhp)
  * Vfs start routine, a no-op.
  */
 /* ARGSUSED */
  * Vfs start routine, a no-op.
  */
 /* ARGSUSED */
+int
 nfs_start(mp, flags, p)
        struct mount *mp;
        int flags;
 nfs_start(mp, flags, p)
        struct mount *mp;
        int flags;
@@ -585,6 +608,7 @@ nfs_start(mp, flags, p)
 /*
  * Do operations associated with quotas, not supported
  */
 /*
  * Do operations associated with quotas, not supported
  */
+int
 nfs_quotactl(mp, cmd, uid, arg, p)
        struct mount *mp;
        int cmd;
 nfs_quotactl(mp, cmd, uid, arg, p)
        struct mount *mp;
        int cmd;
index 736bc49..6033f0d 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfs_vnops.c 7.60 (Berkeley) 5/24/91
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00090
- * --------------------         -----   ----------------------
- *
- * 02 Mar 93   Greg Hackney            Make NFS client POSIX compliant (anon)
- *
+ *     From:   @(#)nfs_vnops.c 7.60 (Berkeley) 5/24/91
+ *     $Id$
  */
 
 /*
  */
 
 /*
@@ -207,6 +200,7 @@ int nfs_numasync = 0;
 /*
  * nfs null call from vfs.
  */
 /*
  * nfs null call from vfs.
  */
+int
 nfs_null(vp, cred, p)
        struct vnode *vp;
        struct ucred *cred;
 nfs_null(vp, cred, p)
        struct vnode *vp;
        struct ucred *cred;
@@ -227,6 +221,7 @@ nfs_null(vp, cred, p)
  * nfs access vnode op.
  * Essentially just get vattr and then imitate iaccess()
  */
  * nfs access vnode op.
  * Essentially just get vattr and then imitate iaccess()
  */
+int
 nfs_access(vp, mode, cred, p)
        struct vnode *vp;
        int mode;
 nfs_access(vp, mode, cred, p)
        struct vnode *vp;
        int mode;
@@ -273,6 +268,7 @@ found:
  * Just check to see if the type is ok
  */
 /* ARGSUSED */
  * Just check to see if the type is ok
  */
 /* ARGSUSED */
+int
 nfs_open(vp, mode, cred, p)
        struct vnode *vp;
        int mode;
 nfs_open(vp, mode, cred, p)
        struct vnode *vp;
        int mode;
@@ -293,6 +289,7 @@ nfs_open(vp, mode, cred, p)
  * For reg files, invalidate any buffer cache entries.
  */
 /* ARGSUSED */
  * For reg files, invalidate any buffer cache entries.
  */
 /* ARGSUSED */
+int
 nfs_close(vp, fflags, cred, p)
        register struct vnode *vp;
        int fflags;
 nfs_close(vp, fflags, cred, p)
        register struct vnode *vp;
        int fflags;
@@ -319,6 +316,7 @@ nfs_close(vp, fflags, cred, p)
 /*
  * nfs getattr call from vfs.
  */
 /*
  * nfs getattr call from vfs.
  */
+int
 nfs_getattr(vp, vap, cred, p)
        register struct vnode *vp;
        struct vattr *vap;
 nfs_getattr(vp, vap, cred, p)
        register struct vnode *vp;
        struct vattr *vap;
@@ -328,6 +326,7 @@ nfs_getattr(vp, vap, cred, p)
        return (nfs_dogetattr(vp, vap, cred, 0, p));
 }
 
        return (nfs_dogetattr(vp, vap, cred, 0, p));
 }
 
+int
 nfs_dogetattr(vp, vap, cred, tryhard, p)
        register struct vnode *vp;
        struct vattr *vap;
 nfs_dogetattr(vp, vap, cred, tryhard, p)
        register struct vnode *vp;
        struct vattr *vap;
@@ -357,6 +356,7 @@ nfs_dogetattr(vp, vap, cred, tryhard, p)
 /*
  * nfs setattr call.
  */
 /*
  * nfs setattr call.
  */
+int
 nfs_setattr(vp, vap, cred, p)
        register struct vnode *vp;
        register struct vattr *vap;
 nfs_setattr(vp, vap, cred, p)
        register struct vnode *vp;
        register struct vattr *vap;
@@ -416,6 +416,7 @@ nfs_setattr(vp, vap, cred, p)
  * First look in cache
  * If not found, unlock the directory nfsnode and do the rpc
  */
  * First look in cache
  * If not found, unlock the directory nfsnode and do the rpc
  */
+int
 nfs_lookup(vp, ndp, p)
        register struct vnode *vp;
        register struct nameidata *ndp;
 nfs_lookup(vp, ndp, p)
        register struct vnode *vp;
        register struct nameidata *ndp;
@@ -608,6 +609,7 @@ nfsmout:
  * nfs read call.
  * Just call nfs_bioread() to do the work.
  */
  * nfs read call.
  * Just call nfs_bioread() to do the work.
  */
+int
 nfs_read(vp, uiop, ioflag, cred)
        register struct vnode *vp;
        struct uio *uiop;
 nfs_read(vp, uiop, ioflag, cred)
        register struct vnode *vp;
        struct uio *uiop;
@@ -622,6 +624,7 @@ nfs_read(vp, uiop, ioflag, cred)
 /*
  * nfs readlink call
  */
 /*
  * nfs readlink call
  */
+int
 nfs_readlink(vp, uiop, cred)
        struct vnode *vp;
        struct uio *uiop;
 nfs_readlink(vp, uiop, cred)
        struct vnode *vp;
        struct uio *uiop;
@@ -636,6 +639,7 @@ nfs_readlink(vp, uiop, cred)
  * Do a readlink rpc.
  * Called by nfs_doio() from below the buffer cache.
  */
  * Do a readlink rpc.
  * Called by nfs_doio() from below the buffer cache.
  */
+int
 nfs_readlinkrpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
 nfs_readlinkrpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
@@ -664,6 +668,7 @@ nfs_readlinkrpc(vp, uiop, cred)
  * nfs read rpc call
  * Ditto above
  */
  * nfs read rpc call
  * Ditto above
  */
+int
 nfs_readrpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
 nfs_readrpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
@@ -707,6 +712,7 @@ nfsmout:
 /*
  * nfs write call
  */
 /*
  * nfs write call
  */
+int
 nfs_writerpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
 nfs_writerpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
@@ -749,6 +755,7 @@ nfsmout:
  * set to specify the file type and the size field for rdev.
  */
 /* ARGSUSED */
  * set to specify the file type and the size field for rdev.
  */
 /* ARGSUSED */
+int
 nfs_mknod(ndp, vap, cred, p)
        struct nameidata *ndp;
        struct ucred *cred;
 nfs_mknod(ndp, vap, cred, p)
        struct nameidata *ndp;
        struct ucred *cred;
@@ -800,6 +807,7 @@ nfs_mknod(ndp, vap, cred, p)
 /*
  * nfs file create call
  */
 /*
  * nfs file create call
  */
+int
 nfs_create(ndp, vap, p)
        register struct nameidata *ndp;
        register struct vattr *vap;
 nfs_create(ndp, vap, p)
        register struct nameidata *ndp;
        register struct vattr *vap;
@@ -847,6 +855,7 @@ nfs_create(ndp, vap, p)
  *     else
  *       do the remove rpc
  */
  *     else
  *       do the remove rpc
  */
+int
 nfs_remove(ndp, p)
        register struct nameidata *ndp;
        struct proc *p;
 nfs_remove(ndp, p)
        register struct nameidata *ndp;
        struct proc *p;
@@ -895,6 +904,7 @@ nfs_remove(ndp, p)
 /*
  * nfs file remove rpc called from nfs_inactive
  */
 /*
  * nfs file remove rpc called from nfs_inactive
  */
+int
 nfs_removeit(sp, p)
        register struct sillyrename *sp;
        struct proc *p;
 nfs_removeit(sp, p)
        register struct sillyrename *sp;
        struct proc *p;
@@ -921,6 +931,7 @@ nfs_removeit(sp, p)
 /*
  * nfs file rename call
  */
 /*
  * nfs file rename call
  */
+int
 nfs_rename(sndp, tndp, p)
        register struct nameidata *sndp, *tndp;
        struct proc *p;
 nfs_rename(sndp, tndp, p)
        register struct nameidata *sndp, *tndp;
        struct proc *p;
@@ -969,6 +980,7 @@ nfs_rename(sndp, tndp, p)
 /*
  * nfs file rename rpc called from nfs_remove() above
  */
 /*
  * nfs file rename rpc called from nfs_remove() above
  */
+int
 nfs_renameit(sndp, sp, p)
        register struct nameidata *sndp;
        register struct sillyrename *sp;
 nfs_renameit(sndp, sp, p)
        register struct nameidata *sndp;
        register struct sillyrename *sp;
@@ -1001,6 +1013,7 @@ nfs_renameit(sndp, sp, p)
 /*
  * nfs hard link create call
  */
 /*
  * nfs hard link create call
  */
+int
 nfs_link(vp, ndp, p)
        register struct vnode *vp;
        register struct nameidata *ndp;
 nfs_link(vp, ndp, p)
        register struct vnode *vp;
        register struct nameidata *ndp;
@@ -1041,6 +1054,7 @@ nfs_link(vp, ndp, p)
 /*
  * nfs symbolic link create call
  */
 /*
  * nfs symbolic link create call
  */
+int
 nfs_symlink(ndp, vap, nm, p)
        struct nameidata *ndp;
        struct vattr *vap;
 nfs_symlink(ndp, vap, nm, p)
        struct nameidata *ndp;
        struct vattr *vap;
@@ -1085,6 +1099,7 @@ nfs_symlink(ndp, vap, nm, p)
 /*
  * nfs make dir call
  */
 /*
  * nfs make dir call
  */
+int
 nfs_mkdir(ndp, vap, p)
        register struct nameidata *ndp;
        struct vattr *vap;
 nfs_mkdir(ndp, vap, p)
        register struct nameidata *ndp;
        struct vattr *vap;
@@ -1148,6 +1163,7 @@ nfs_mkdir(ndp, vap, p)
 /*
  * nfs remove directory call
  */
 /*
  * nfs remove directory call
  */
+int
 nfs_rmdir(ndp, p)
        register struct nameidata *ndp;
        struct proc *p;
 nfs_rmdir(ndp, p)
        register struct nameidata *ndp;
        struct proc *p;
@@ -1192,6 +1208,7 @@ nfs_rmdir(ndp, p)
  * order so that it looks more sensible. This appears consistent with the
  * Ultrix implementation of NFS.
  */
  * order so that it looks more sensible. This appears consistent with the
  * Ultrix implementation of NFS.
  */
+int
 nfs_readdir(vp, uiop, cred, eofflagp)
        register struct vnode *vp;
        struct uio *uiop;
 nfs_readdir(vp, uiop, cred, eofflagp)
        register struct vnode *vp;
        struct uio *uiop;
@@ -1234,6 +1251,7 @@ nfs_readdir(vp, uiop, cred, eofflagp)
  * Readdir rpc call.
  * Called from below the buffer cache by nfs_doio().
  */
  * Readdir rpc call.
  * Called from below the buffer cache by nfs_doio().
  */
+int
 nfs_readdirrpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
 nfs_readdirrpc(vp, uiop, cred)
        register struct vnode *vp;
        struct uio *uiop;
@@ -1382,6 +1400,7 @@ static char hextoasc[] = "0123456789abcdef";
  * to create the same funny name between the nfs_lookitup() fails and the
  * nfs_rename() completes, but...
  */
  * to create the same funny name between the nfs_lookitup() fails and the
  * nfs_rename() completes, but...
  */
+int
 nfs_sillyrename(ndp, p)
        register struct nameidata *ndp;
        struct proc *p;
 nfs_sillyrename(ndp, p)
        register struct nameidata *ndp;
        struct proc *p;
@@ -1436,6 +1455,7 @@ bad:
  * into the nfsnode table.
  * If fhp != NULL it copies the returned file handle out
  */
  * into the nfsnode table.
  * If fhp != NULL it copies the returned file handle out
  */
+int
 nfs_lookitup(sp, fhp, p)
        register struct sillyrename *sp;
        nfsv2fh_t *fhp;
 nfs_lookitup(sp, fhp, p)
        register struct sillyrename *sp;
        nfsv2fh_t *fhp;
@@ -1476,6 +1496,7 @@ nfs_lookitup(sp, fhp, p)
  *    a lot more work than bcopy() and also it currently happens in the
  *    context of the swapper process (2).
  */
  *    a lot more work than bcopy() and also it currently happens in the
  *    context of the swapper process (2).
  */
+int
 nfs_bmap(vp, bn, vpp, bnp)
        struct vnode *vp;
        daddr_t bn;
 nfs_bmap(vp, bn, vpp, bnp)
        struct vnode *vp;
        daddr_t bn;
@@ -1494,6 +1515,7 @@ nfs_bmap(vp, bn, vpp, bnp)
  * If the biod's are running, queue a request
  * otherwise just call nfs_doio() to get it done
  */
  * If the biod's are running, queue a request
  * otherwise just call nfs_doio() to get it done
  */
+int
 nfs_strategy(bp)
        register struct buf *bp;
 {
 nfs_strategy(bp)
        register struct buf *bp;
 {
@@ -1552,6 +1574,7 @@ nfs_strategy(bp)
  * otherwise it is called by the nfsiods to do what would normally be
  * partially disk interrupt driven.
  */
  * otherwise it is called by the nfsiods to do what would normally be
  * partially disk interrupt driven.
  */
+int
 nfs_doio(bp)
        register struct buf *bp;
 {
 nfs_doio(bp)
        register struct buf *bp;
 {
@@ -1559,7 +1582,7 @@ nfs_doio(bp)
        register struct vnode *vp;
        struct nfsnode *np;
        struct ucred *cr;
        register struct vnode *vp;
        struct nfsnode *np;
        struct ucred *cr;
-       int error;
+       int error = 0;
        struct uio uio;
        struct iovec io;
 #if !defined(hp300) && !defined(i386)
        struct uio uio;
        struct iovec io;
 #if !defined(hp300) && !defined(i386)
@@ -1637,6 +1660,8 @@ nfs_doio(bp)
                                 */
                                bp->b_blkno = uiop->uio_offset;
                                break;
                                 */
                                bp->b_blkno = uiop->uio_offset;
                                break;
+                             default:
+                               panic("nfs_doio bad type");
                        };
                        bp->b_error = error;
                } else {
                        };
                        bp->b_error = error;
                } else {
@@ -1669,6 +1694,7 @@ nfs_doio(bp)
  * NB Currently unsupported.
  */
 /* ARGSUSED */
  * NB Currently unsupported.
  */
 /* ARGSUSED */
+int
 nfs_mmap(vp, fflags, cred, p)
        struct vnode *vp;
        int fflags;
 nfs_mmap(vp, fflags, cred, p)
        struct vnode *vp;
        int fflags;
@@ -1685,6 +1711,7 @@ nfs_mmap(vp, fflags, cred, p)
  *     associated with the vnode.
  */
 /* ARGSUSED */
  *     associated with the vnode.
  */
 /* ARGSUSED */
+int
 nfs_fsync(vp, fflags, cred, waitfor, p)
        register struct vnode *vp;
        int fflags;
 nfs_fsync(vp, fflags, cred, waitfor, p)
        register struct vnode *vp;
        int fflags;
@@ -1708,6 +1735,7 @@ nfs_fsync(vp, fflags, cred, waitfor, p)
  * NFS advisory byte-level locks.
  * Currently unsupported.
  */
  * NFS advisory byte-level locks.
  * Currently unsupported.
  */
+int
 nfs_advlock(vp, id, op, fl, flags)
        struct vnode *vp;
        caddr_t id;
 nfs_advlock(vp, id, op, fl, flags)
        struct vnode *vp;
        caddr_t id;
@@ -1722,6 +1750,7 @@ nfs_advlock(vp, id, op, fl, flags)
 /*
  * Print out the contents of an nfsnode.
  */
 /*
  * Print out the contents of an nfsnode.
  */
+int
 nfs_print(vp)
        struct vnode *vp;
 {
 nfs_print(vp)
        struct vnode *vp;
 {
@@ -1740,4 +1769,5 @@ nfs_print(vp)
        if (np->n_lockwaiter)
                printf(" waiting pid %d", np->n_lockwaiter);
        printf("\n");
        if (np->n_lockwaiter)
                printf(" waiting pid %d", np->n_lockwaiter);
        printf("\n");
+       return(0);
 }
 }
index fed621c..7f71b7e 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfscompress.h       7.2 (Berkeley) 10/2/90
+ *     From:   @(#)nfscompress.h       7.2 (Berkeley) 10/2/90
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfscompress
+#define __h_nfscompress 1
+
 /*
  * Definitions for the compression algorithm
  */
 /*
  * Definitions for the compression algorithm
  */
@@ -76,3 +80,5 @@
                        (c) = *ip++; \
                        ileft--; \
                }
                        (c) = *ip++; \
                        ileft--; \
                }
+
+#endif /* __h_nfscompress */
index bee5d12..b1cd3b5 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsdiskless.h       7.1 (Berkeley) 3/4/91
+ *     From:   @(#)nfsdiskless.h       7.1 (Berkeley) 3/4/91
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsdiskless
+#define __h_nfsdiskless 1
+
 /*
  * Structure that must be initialized for a diskless nfs client.
  * This structure is used by nfs_mountroot() to set up the root and swap
 /*
  * Structure that must be initialized for a diskless nfs client.
  * This structure is used by nfs_mountroot() to set up the root and swap
@@ -56,3 +60,5 @@ struct nfs_diskless {
        struct sockaddr root_saddr;     /* Address of root server */
        char            *root_hostnam;  /* Host name for mount pt */
 };
        struct sockaddr root_saddr;     /* Address of root server */
        char            *root_hostnam;  /* Host name for mount pt */
 };
+
+#endif /* __h_nfsdiskless */
index 0466b7a..1d3ebc5 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsiom.h    7.3 (Berkeley) 6/28/90
+ *     From:   @(#)nfsiom.h    7.3 (Berkeley) 6/28/90
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsiom
+#define __h_nfsiom 1
+
 /*
  * Size of the resource map and system page table pte's that are mapped
  * by nfs for i/o much like a bus adapter
 /*
  * Size of the resource map and system page table pte's that are mapped
  * by nfs for i/o much like a bus adapter
@@ -43,3 +47,5 @@
 #define        NFS_MAPREG      512     /* Num. of kernel pte's for i/o mapping */
                                /* Must be >= MAXPHYS/NBPG */
 #define        NFS_MSIZ        100     /* Size of alloc. map for pte's */
 #define        NFS_MAPREG      512     /* Num. of kernel pte's for i/o mapping */
                                /* Must be >= MAXPHYS/NBPG */
 #define        NFS_MSIZ        100     /* Size of alloc. map for pte's */
+
+#endif /* __h_nfsiom */
index 7bbf77c..9841f65 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsm_subs.h 7.11 (Berkeley) 4/16/91
+ *     From:   @(#)nfsm_subs.h 7.11 (Berkeley) 4/16/91
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsm_subs
+#define __h_nfsm_subs 1
+
 /*
  * These macros do strange and peculiar things to mbuf chains for
  * the assistance of the nfs code. To attempt to use them for any
 /*
  * These macros do strange and peculiar things to mbuf chains for
  * the assistance of the nfs code. To attempt to use them for any
@@ -299,3 +303,18 @@ extern struct mbuf *nfsm_reqh();
        fp->fa_ctime.tv_sec = txdr_unsigned(vap->va_ctime.tv_sec); \
        fp->fa_ctime.tv_usec = txdr_unsigned(vap->va_gen)
 
        fp->fa_ctime.tv_sec = txdr_unsigned(vap->va_ctime.tv_sec); \
        fp->fa_ctime.tv_usec = txdr_unsigned(vap->va_gen)
 
+/* These are here to provide prototypes for everything in the NFS system.
+ * Added 8.6.-93, Garrett A. Wollman, University of Vermont. */
+struct nfsmount;
+
+void nfs_updatetimer __P((struct nfsmount *));
+void nfs_backofftimer __P((struct nfsmount *));
+int nfs_sigintr __P((struct proc *));
+void nfs_msg __P((struct proc *, const char *, const char *));
+void nfs_solock __P((int *));
+void nfs_sounlock __P((int *));
+int nfs_netaddr_match __P((struct mbuf *, struct mbuf *));
+int nfs_badnam __P((struct mbuf *, struct mbuf *, struct mbuf *));
+
+
+#endif /* __h_nfsm_subs */
index a2a2c5d..fd7b33b 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsmount.h  7.7 (Berkeley) 4/16/91
+ *     From:   @(#)nfsmount.h  7.7 (Berkeley) 4/16/91
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsmount
+#define __h_nfsmount 1
+
 /*
  * Mount structure.
  * One allocated on every NFS mount.
 /*
  * Mount structure.
  * One allocated on every NFS mount.
@@ -115,3 +119,5 @@ int nfs_vptofh __P((
                struct vnode *vp,
                struct fid *fhp));
 int    nfs_init __P(());
                struct vnode *vp,
                struct fid *fhp));
 int    nfs_init __P(());
+
+#endif /* __h_nfsmount */
index e08a338..2beeebc 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsnode.h   7.12 (Berkeley) 4/16/91
+ *     From:   @(#)nfsnode.h   7.12 (Berkeley) 4/16/91
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsnode
+#define __h_nfsnode 1
+
 /*
  * The nfsnode is the nfs equivalent to ufs's inode. Any similarity
  * is purely coincidental.
 /*
  * The nfsnode is the nfs equivalent to ufs's inode. Any similarity
  * is purely coincidental.
@@ -219,3 +223,6 @@ int nfs_advlock __P((
                int op,
                struct flock *fl,
                int flags));
                int op,
                struct flock *fl,
                int flags));
+
+void   nfs_nput __P((struct vnode *));
+#endif /* __h_nfsnode */
index 7aa6f81..c0b66bc 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsrvcache.h        7.3 (Berkeley) 6/28/90
+ *     From:   @(#)nfsrvcache.h        7.3 (Berkeley) 6/28/90
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsrvcache
+#define __h_nfsrvcache 1
+
 /*
  * Definitions for the server recent request cache
  */
 /*
  * Definitions for the server recent request cache
  */
@@ -91,3 +95,5 @@ struct nfsrvcache {
 /* Delay time after completion that request is dropped */
 #define        RC_DELAY        2               /* seconds */
 
 /* Delay time after completion that request is dropped */
 #define        RC_DELAY        2               /* seconds */
 
+
+#endif /* __h_nfsrvcache */
index 365696b..30ecd81 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)nfsv2.h     7.8 (Berkeley) 6/28/90
- *
- * PATCHES MAGIC                LEVEL   PATCH THAT GOT US HERE
- * --------------------         -----   ----------------------
- * CURRENT PATCH LEVEL:         1       00053
- * --------------------         -----   ----------------------
- *
- * 08 Sep 92    Rick "gopher I"         Fix "reserved port" bug, fixed for
- *                                              AIX3.2 NFS clients
+ *     From:   @(#)nfsv2.h     7.8 (Berkeley) 6/28/90
+ *     $Id$
  */
 
  */
 
+#ifndef __h_nfsv2
+#define __h_nfsv2 1
+
 /*
  * nfs definitions as per the version 2 specs
  */
 /*
  * nfs definitions as per the version 2 specs
  */
@@ -166,3 +162,5 @@ struct nfsv2_statfs {
        u_long  sf_bfree;
        u_long  sf_bavail;
 };
        u_long  sf_bfree;
        u_long  sf_bavail;
 };
+
+#endif /* __h_nfsv2 */
index 8f81484..1808103 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)rpcv2.h     7.4 (Berkeley) 6/28/90
+ *     From:   @(#)rpcv2.h     7.4 (Berkeley) 6/28/90
+ *     $Id$
  */
 
  */
 
+#ifndef __h_rpcv2
+#define __h_rpcv2 1
+
 /*
  * Definitions for Sun RPC Version 2, from
  * "RPC: Remote Procedure Call Protocol Specification" RFC1057
 /*
  * Definitions for Sun RPC Version 2, from
  * "RPC: Remote Procedure Call Protocol Specification" RFC1057
@@ -85,3 +89,5 @@
 #define        RPCMNT_NAMELEN  255
 #define        RPCMNT_PATHLEN  1024
 #define        RPCPROG_NFS     100003
 #define        RPCMNT_NAMELEN  255
 #define        RPCMNT_PATHLEN  1024
 #define        RPCPROG_NFS     100003
+
+#endif /* __h_rpcv2 */
index 5bf212d..08819c3 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)xdr_subs.h  7.3 (Berkeley) 6/28/90
+ *     From:   @(#)xdr_subs.h  7.3 (Berkeley) 6/28/90
+ *     $Id$
  */
 
  */
 
+#ifndef __h_xdr_subs
+#define __h_xdr_subs 1
+
 /*
  * Macros used for conversion to/from xdr representation by nfs...
  * These use the MACHINE DEPENDENT routines ntohl, htonl
 /*
  * Macros used for conversion to/from xdr representation by nfs...
  * These use the MACHINE DEPENDENT routines ntohl, htonl
@@ -55,3 +59,5 @@
                                ((struct timeval *)(t))->tv_usec=htonl( \
                                ((struct timeval *)(f))->tv_usec);}
 
                                ((struct timeval *)(t))->tv_usec=htonl( \
                                ((struct timeval *)(f))->tv_usec);}
 
+
+#endif /* __h_xdr_subs */