Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jan 2012 03:42:40 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r230186 - in projects/nfsv4.1-client/sys/fs: nfs nfsclient
Message-ID:  <201201160342.q0G3ge7Y013775@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Mon Jan 16 03:42:40 2012
New Revision: 230186
URL: http://svn.freebsd.org/changeset/base/230186

Log:
  Change nfsrpc_createsession() so that it takes the nfsclsession structure
  as an argument instead of nfsclclient. This allows it to be used to
  create DS sessions.

Modified:
  projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h
  projects/nfsv4.1-client/sys/fs/nfs/nfsclstate.h
  projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h	Mon Jan 16 02:42:41 2012	(r230185)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h	Mon Jan 16 03:42:40 2012	(r230186)
@@ -438,7 +438,7 @@ int nfsrpc_getacl(vnode_t, struct ucred 
 int nfsrpc_setacl(vnode_t, struct ucred *, NFSPROC_T *, NFSACL_T *, void *);
 int nfsrpc_exchangeid(struct nfsmount *, struct nfsclclient *,
     struct nfsclsession *, uint32_t, struct ucred *, NFSPROC_T *);
-int nfsrpc_createsession(struct nfsmount *, struct nfsclclient *,
+int nfsrpc_createsession(struct nfsmount *, struct nfsclsession *,
     struct ucred *, NFSPROC_T *);
 int nfsrpc_destroysession(struct nfsmount *, struct nfsclclient *,
     struct ucred *, NFSPROC_T *);

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfsclstate.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfsclstate.h	Mon Jan 16 02:42:41 2012	(r230185)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsclstate.h	Mon Jan 16 03:42:40 2012	(r230186)
@@ -65,6 +65,7 @@ struct nfsclsession {
 	uint64_t	nfsess_slots;
 	uint32_t	nfsess_sequenceid;
 	uint16_t	nfsess_foreslots;
+	uint16_t	nfsess_backslots;
 	uint8_t		nfsess_sessionid[NFSX_V4SESSIONID];
 };
 
@@ -87,7 +88,6 @@ struct nfsclclient {
 	u_int32_t		nfsc_renew;
 	u_int32_t		nfsc_cbident;
 	u_int16_t		nfsc_flags;
-	u_int16_t		nfsc_backslots;	/* # of back channel slots. */
 	u_int16_t		nfsc_idlen;
 	u_int8_t		nfsc_id[1];	/* Malloc'd to correct length */
 };
@@ -99,6 +99,7 @@ struct nfsclclient {
 #define	nfsc_slots	nfsc_sess.nfsess_slots
 #define	nfsc_sequenceid	nfsc_sess.nfsess_sequenceid
 #define	nfsc_foreslots	nfsc_sess.nfsess_foreslots
+#define	nfsc_backslots	nfsc_sess.nfsess_backslots
 #define	nfsc_sessionid	nfsc_sess.nfsess_sessionid
 
 /*

Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c	Mon Jan 16 02:42:41 2012	(r230185)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c	Mon Jan 16 03:42:40 2012	(r230186)
@@ -798,7 +798,8 @@ nfsrpc_setclient(struct nfsmount *nmp, s
 		    NFSV4EXCH_USEPNFSMDS | NFSV4EXCH_USENONPNFS, cred, p);
 if (error) printf("exch=%d\n",error);
 		if (error == 0)
-			error = nfsrpc_createsession(nmp, clp, cred, p);
+			error = nfsrpc_createsession(nmp, &clp->nfsc_sess, cred,
+			    p);
 if (error) printf("aft crs=%d\n",error);
 		return (error);
 	}
@@ -4335,7 +4336,7 @@ nfsmout:
  * Do the NFSv4.1 Create Session.
  */
 int
-nfsrpc_createsession(struct nfsmount *nmp, struct nfsclclient *clp,
+nfsrpc_createsession(struct nfsmount *nmp, struct nfsclsession *sep,
     struct ucred *cred, NFSPROC_T *p)
 {
 	uint32_t *tl;
@@ -4345,10 +4346,10 @@ nfsrpc_createsession(struct nfsmount *nm
 
 	nfscl_reqstart(nd, NFSPROC_CREATESESSION, nmp, NULL, 0, NULL, NULL);
 	NFSM_BUILD(tl, uint32_t *, 4 * NFSX_UNSIGNED);
-	*tl++ = clp->nfsc_clientid.lval[0];
-	*tl++ = clp->nfsc_clientid.lval[1];
-	*tl++ = txdr_unsigned(clp->nfsc_sequenceid);
-printf("clseq0=0x%x\n",clp->nfsc_sequenceid);
+	*tl++ = sep->nfsess_clientid.lval[0];
+	*tl++ = sep->nfsess_clientid.lval[1];
+	*tl++ = txdr_unsigned(sep->nfsess_sequenceid);
+printf("clseq0=0x%x\n",sep->nfsess_sequenceid);
 	if (nfscl_enablecallb != 0 && nfs_numnfscbd > 0)
 		*tl = txdr_unsigned(NFSV4CRSESS_PERSIST |
 		    NFSV4CRSESS_CONNBACKCHAN);
@@ -4394,10 +4395,10 @@ printf("clseq0=0x%x\n",clp->nfsc_sequenc
 	if (nd->nd_repstat == 0) {
 		NFSM_DISSECT(tl, uint32_t *, NFSX_V4SESSIONID +
 		    2 * NFSX_UNSIGNED);
-		bcopy(tl, clp->nfsc_sessionid, NFSX_V4SESSIONID);
+		bcopy(tl, sep->nfsess_sessionid, NFSX_V4SESSIONID);
 		tl += NFSX_V4SESSIONID / NFSX_UNSIGNED;
-		clp->nfsc_sequenceid = fxdr_unsigned(uint32_t, *tl++);
-printf("clseq=0x%x\n",clp->nfsc_sequenceid);
+		sep->nfsess_sequenceid = fxdr_unsigned(uint32_t, *tl++);
+printf("clseq=0x%x\n",sep->nfsess_sequenceid);
 printf("crfl=0x%x\n",fxdr_unsigned(uint32_t, *tl));
 		/* Don't care about replied flags for now. */
 
@@ -4405,8 +4406,8 @@ printf("crfl=0x%x\n",fxdr_unsigned(uint3
 		NFSM_DISSECT(tl, uint32_t *, 7 * NFSX_UNSIGNED);
 printf("cr %d %d %d %d %d\n",fxdr_unsigned(uint32_t, *tl),fxdr_unsigned(uint32_t, *(tl+1)),fxdr_unsigned(uint32_t, *(tl+2)),fxdr_unsigned(uint32_t, *(tl+3)),fxdr_unsigned(uint32_t, *(tl+4)));
 		tl += 5;		/* Skip the other counts. */		
-		clp->nfsc_foreslots = fxdr_unsigned(uint16_t, *tl++);
-printf("fore slots=%d\n", clp->nfsc_foreslots);
+		sep->nfsess_foreslots = fxdr_unsigned(uint16_t, *tl++);
+printf("fore slots=%d\n", sep->nfsess_foreslots);
 		irdcnt = fxdr_unsigned(int, *tl);
 		if (irdcnt > 0) {
 printf("got an ird cnt=%d\n",irdcnt);
@@ -4416,8 +4417,8 @@ printf("got an ird cnt=%d\n",irdcnt);
 		/* and the back channel slot count. */
 		NFSM_DISSECT(tl, uint32_t *, 7 * NFSX_UNSIGNED);
 		tl += 5;
-		clp->nfsc_backslots = fxdr_unsigned(uint16_t, *tl);
-printf("back slots=%d\n", clp->nfsc_backslots);
+		sep->nfsess_backslots = fxdr_unsigned(uint16_t, *tl);
+printf("back slots=%d\n", sep->nfsess_backslots);
 	}
 	error = nd->nd_repstat;
 nfsmout:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201160342.q0G3ge7Y013775>