Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Feb 2012 02:00:34 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r230973 - in projects/nfsv4.1-client/sys/fs: nfs nfsclient
Message-ID:  <201202040200.q1420YqV014233@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Feb  4 02:00:33 2012
New Revision: 230973
URL: http://svn.freebsd.org/changeset/base/230973

Log:
  Add NFSPROC_WRITEDS to be used for a write to an NFSv4.1 Data Server (DS).
  This is needed, since NFSPROC_WRITE includes a Getattr operation and
  Getattr is not supported by a DS.

Modified:
  projects/nfsv4.1-client/sys/fs/nfs/nfs_commonkrpc.c
  projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c
  projects/nfsv4.1-client/sys/fs/nfs/nfsport.h
  projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h
  projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfs_commonkrpc.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_commonkrpc.c	Sat Feb  4 00:54:43 2012	(r230972)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_commonkrpc.c	Sat Feb  4 02:00:33 2012	(r230973)
@@ -888,6 +888,7 @@ printf("foreslots growing %d\n", retval)
 			     nd->nd_procnum != NFSPROC_SETATTR &&
 			     nd->nd_procnum != NFSPROC_READ &&
 			     nd->nd_procnum != NFSPROC_WRITE &&
+			     nd->nd_procnum != NFSPROC_WRITEDS &&
 			     nd->nd_procnum != NFSPROC_OPEN &&
 			     nd->nd_procnum != NFSPROC_CREATE &&
 			     nd->nd_procnum != NFSPROC_OPENCONFIRM &&

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c	Sat Feb  4 00:54:43 2012	(r230972)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c	Sat Feb  4 02:00:33 2012	(r230973)
@@ -168,7 +168,7 @@ static struct nfsuserlruhead nfsuserlruh
  */
 int nfs_bigreply[NFSV41_NPROCS] = { 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0,
     0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
 
 /* local functions */
 static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep);

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfsport.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfsport.h	Sat Feb  4 00:54:43 2012	(r230972)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsport.h	Sat Feb  4 02:00:33 2012	(r230973)
@@ -348,11 +348,12 @@
 #define	NFSPROC_LAYOUTCOMMIT	48
 #define	NFSPROC_LAYOUTRETURN	49
 #define	NFSPROC_RECLAIMCOMPL	50
+#define	NFSPROC_WRITEDS		51
 
 /*
  * Must be defined as one higher than the last NFSv4.1 Proc# above.
  */
-#define	NFSV41_NPROCS		51
+#define	NFSV41_NPROCS		52
 
 #endif	/* NFS_V3NPROCS */
 

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h	Sat Feb  4 00:54:43 2012	(r230972)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h	Sat Feb  4 02:00:33 2012	(r230973)
@@ -314,11 +314,12 @@
 #define	NFSPROC_LAYOUTCOMMIT	48
 #define	NFSPROC_LAYOUTRETURN	49
 #define	NFSPROC_RECLAIMCOMPL	50
+#define	NFSPROC_WRITEDS		51
 
 /*
  * Must be defined as one higher than the last NFSv4.1 Proc# above.
  */
-#define	NFSV41_NPROCS		51
+#define	NFSV41_NPROCS		52
 
 #endif	/* NFS_V3NPROCS */
 

Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c	Sat Feb  4 00:54:43 2012	(r230972)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c	Sat Feb  4 02:00:33 2012	(r230973)
@@ -109,6 +109,7 @@ static struct {
 	{ NFSV4OP_LAYOUTCOMMIT, 1, "LayoutCommit", 12, },
 	{ NFSV4OP_LAYOUTRETURN, 1, "LayoutReturn", 12, },
 	{ NFSV4OP_RECLAIMCOMPL, 1, "ReclaimComplete", 15, },
+	{ NFSV4OP_WRITE, 1, "WriteDS", 7, },
 };
 
 
@@ -118,7 +119,7 @@ static struct {
 static int nfs_bigrequest[NFSV41_NPROCS] = {
 	0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0
+	0, 0, 0, 0, 0, 0, 1
 };
 
 /*
@@ -174,6 +175,12 @@ nfscl_reqstart(struct nfsrv_descript *nd
 				 * Sequence Op.
 				 */
 				opcnt = 1;
+			else if (procnum == NFSPROC_WRITEDS)
+				/*
+				 * For the special case of a Write to a DS,
+				 * the opcnt == 3, for Sequence, PutFH, Write.
+				 */
+				opcnt = 3;
 		}
 		/*
 		 * What should the tag really be?
@@ -203,7 +210,8 @@ nfscl_reqstart(struct nfsrv_descript *nd
 			NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
 			*tl = txdr_unsigned(NFSV4OP_PUTFH);
 			(void) nfsm_fhtom(nd, nfhp, fhlen, 0);
-			if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh==2){
+			if (nfsv4_opflag[nfsv4_opmap[procnum].op].needscfh
+			    == 2 && procnum != NFSPROC_WRITEDS) {
 				NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED);
 				*tl = txdr_unsigned(NFSV4OP_GETATTR);
 				NFSWCCATTR_ATTRBIT(&attrbits);



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