This commit was generated by cvs2svn to track changes on a CVS vendor
[unix-history] / sys / nfs / nfs_subs.c
index 86537c6..44e2d3c 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: nfs_subs.c,v 1.4 1993/11/25 01:36:52 wollman Exp $
  */
 
 /*
  */
 
 /*
@@ -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"
@@ -67,6 +71,8 @@
 #define TRUE   1
 #define        FALSE   0
 
 #define TRUE   1
 #define        FALSE   0
 
+struct nfsstats nfsstats;
+
 /*
  * Data items converted to xdr at startup, since they are constant
  * This is kinda hokey, but may save a little time doing byte swaps
 /*
  * Data items converted to xdr at startup, since they are constant
  * This is kinda hokey, but may save a little time doing byte swaps
@@ -184,6 +190,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 +265,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;
@@ -265,8 +273,8 @@ nfsm_uiotombuf(uiop, mq, siz, bpos)
        caddr_t *bpos;
 {
        register char *uiocp;
        caddr_t *bpos;
 {
        register char *uiocp;
-       register struct mbuf *mp, *mp2;
-       register int xfer, left, len;
+       register struct mbuf *mp = 0, *mp2;
+       register int xfer, left, len = 0;
        int uiosiz, clflg, rem;
        char *cp;
 
        int uiosiz, clflg, rem;
        char *cp;
 
@@ -343,6 +351,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 +420,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,13 +447,14 @@ 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;
        char *cp;
        long siz;
 {
 nfsm_strtmbuf(mb, bpos, cp, siz)
        struct mbuf **mb;
        char **bpos;
        char *cp;
        long siz;
 {
-       register struct mbuf *m1, *m2;
+       register struct mbuf *m1 = 0, *m2;
        long left, xfer, len, tlen;
        u_long *tl;
        int putsize;
        long left, xfer, len, tlen;
        u_long *tl;
        int putsize;
@@ -502,6 +513,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;
@@ -531,7 +543,7 @@ nfs_init()
         * Initialize reply list and start timer
         */
        nfsreqh.r_prev = nfsreqh.r_next = &nfsreqh;
         * Initialize reply list and start timer
         */
        nfsreqh.r_prev = nfsreqh.r_next = &nfsreqh;
-       nfs_timer();
+       nfs_timer(0);
 }
 
 /*
 }
 
 /*
@@ -596,6 +608,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;
@@ -638,7 +651,7 @@ nfs_loadattrcache(vpp, mdp, dposp, vaper)
         */
        np = VTONFS(vp);
        if (vp->v_type == VNON) {
         */
        np = VTONFS(vp);
        if (vp->v_type == VNON) {
-               if (type == VCHR && rdev == 0xffffffff)
+               if (type == VCHR && rdev == 0xffffffffUL)
                        vp->v_type = type = VFIFO;
                else
                        vp->v_type = type;
                        vp->v_type = type = VFIFO;
                else
                        vp->v_type = type;
@@ -715,6 +728,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 +754,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 +862,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 +928,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;