Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Dec 2011 23:56:58 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r229163 - in projects/nfsv4.1-client/sys/fs: nfs nfsclient
Message-ID:  <201112312356.pBVNuwOL088581@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sat Dec 31 23:56:58 2011
New Revision: 229163
URL: http://svn.freebsd.org/changeset/base/229163

Log:
  Add the "glue" needed for the 4 NFSv4.1 Ops that are used for
  handling NFSV4.1 pNFS layouts. This also includes flags and
  error return values used by these Operations.
  The functions that implement
  these operations will be coming soon.

Modified:
  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_commonsubs.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c	Sat Dec 31 23:41:19 2011	(r229162)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c	Sat Dec 31 23:56:58 2011	(r229163)
@@ -133,9 +133,9 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_
 	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Get Dir Deleg */
 	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Get Device Info */
 	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Get Device List */
-	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Layout Commit */
-	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Layout Get */
-	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Layout Return */
+	{ 0, 1, 0, 0, LK_EXCLUSIVE, 1 },		/* Layout Commit */
+	{ 0, 1, 0, 0, LK_EXCLUSIVE, 1 },		/* Layout Get */
+	{ 0, 1, 0, 0, LK_EXCLUSIVE, 1 },		/* Layout Return */
 	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Secinfo No name */
 	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Sequence */
 	{ 0, 0, 0, 0, LK_EXCLUSIVE, 1 },		/* Set SSV */
@@ -166,7 +166,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 };
 
 /* 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 Dec 31 23:41:19 2011	(r229162)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsport.h	Sat Dec 31 23:56:58 2011	(r229163)
@@ -343,11 +343,15 @@
 #define	NFSPROC_DESTROYSESSION	43
 #define	NFSPROC_DESTROYCLIENT	44
 #define	NFSPROC_FREESTATEID	45
+#define	NFSPROC_LAYOUTGET	46
+#define	NFSPROC_GETDEVICEINFO	47
+#define	NFSPROC_LAYOUTCOMMIT	48
+#define	NFSPROC_LAYOUTRETURN	49
 
 /*
  * Must be defined as one higher than the last NFSv4.1 Proc# above.
  */
-#define	NFSV41_NPROCS		46
+#define	NFSV41_NPROCS		50
 
 #endif	/* NFS_V3NPROCS */
 
@@ -818,6 +822,7 @@ void newnfs_realign(struct mbuf **);
 #define	NFSSTA_TIMEO		0x10000000  /* Experiencing a timeout */
 #define	NFSSTA_LOCKTIMEO	0x20000000  /* Experiencing a lockd timeout */
 #define	NFSSTA_HASSETFSID	0x40000000  /* Has set the fsid */
+#define	NFSSTA_PNFS		0x80000000  /* pNFS is enabled */
 
 #define	NFSHASNFSV3(n)		((n)->nm_flag & NFSMNT_NFSV3)
 #define	NFSHASNFSV4(n)		((n)->nm_flag & NFSMNT_NFSV4)
@@ -838,6 +843,7 @@ void newnfs_realign(struct mbuf **);
 #define	NFSHASPRIVACY(n)	((n)->nm_flag & NFSMNT_PRIVACY)
 #define	NFSSETWRITEVERF(n)	((n)->nm_state |= NFSSTA_HASWRITEVERF)
 #define	NFSSETHASSETFSID(n)	((n)->nm_state |= NFSSTA_HASSETFSID)
+#define	NFSHASPNFS(n)		((n)->nm_state & NFSSTA_PNFS)
 
 /*
  * Gets the stats field out of the mount structure.

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h	Sat Dec 31 23:41:19 2011	(r229162)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h	Sat Dec 31 23:56:58 2011	(r229163)
@@ -149,6 +149,7 @@
 
 /* NFSv4.1 specific errors. */
 #define	NFSERR_BADSLOT		10053
+#define	NFSERR_LAYOUTTRYLATER	10058
 #define	NFSERR_SEQMISORDERED	10063
 #define	NFSERR_SEQUENCEPOS	10064
 #define	NFSERR_OPNOTINSESS	10071
@@ -198,6 +199,7 @@
 #define	NFSX_V4TIME		(NFSX_HYPER + NFSX_UNSIGNED)
 #define	NFSX_V4SETTIME		(NFSX_UNSIGNED + NFSX_V4TIME)
 #define	NFSX_V4SESSIONID	16
+#define	NFSX_V4DEVICEID		16
 
 /* sizes common to multiple NFS versions */
 #define	NFSX_FHMAX		(NFSX_V4FHMAX)
@@ -274,11 +276,15 @@
 #define	NFSPROC_DESTROYSESSION	43
 #define	NFSPROC_DESTROYCLIENT	44
 #define	NFSPROC_FREESTATEID	45
+#define	NFSPROC_LAYOUTGET	46
+#define	NFSPROC_GETDEVICEINFO	47
+#define	NFSPROC_LAYOUTCOMMIT	48
+#define	NFSPROC_LAYOUTRETURN	49
 
 /*
  * Must be defined as one higher than the last NFSv4.1 Proc# above.
  */
-#define	NFSV41_NPROCS		46
+#define	NFSV41_NPROCS		50
 
 #endif	/* NFS_V3NPROCS */
 
@@ -526,6 +532,23 @@
 #define	NFSV4SEQ_DEVIDCHANGED		0x00000800
 #define	NFSV4SEQ_DEVIDDELETED		0x00001000
 
+/* Flags for Layout. */
+#define	NFSLAYOUTRETURN_FILE		1
+#define	NFSLAYOUTRETURN_FSID		2
+#define	NFSLAYOUTRETURN_ALL		3
+
+#define	NFSLAYOUT_NFSV4_1_FILES		0x1
+#define	NFSLAYOUT_OSD2_OBJECTS		0x2
+#define	NFSLAYOUT_BLOCK_VOLUME		0x3
+
+#define	NFSLAYOUTIOMODE_READ		1
+#define	NFSLAYOUTIOMODE_RW		2
+#define	NFSLAYOUTIOMODE_ANY		3
+
+/* Flags for Get Device Info. */
+#define	NFSDEVICEIDNOTIFY_CHANGEBIT	0x1
+#define	NFSDEVICEIDNOTIFY_DELETEBIT	0x2
+
 /* Conversion macros */
 #define	vtonfsv2_mode(t,m) 						\
 		txdr_unsigned(((t) == VFIFO) ? MAKEIMODE(VCHR, (m)) : 	\

Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c	Sat Dec 31 23:41:19 2011	(r229162)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c	Sat Dec 31 23:56:58 2011	(r229163)
@@ -104,6 +104,10 @@ static struct {
 	{ NFSV4OP_DESTROYSESSION, 1, "DestroySession", 14, },
 	{ NFSV4OP_DESTROYCLIENTID, 1, "DestroyClient", 13, },
 	{ NFSV4OP_FREESTATEID, 1, "FreeStateID", 11, },
+	{ NFSV4OP_LAYOUTGET, 1, "LayoutGet", 9, },
+	{ NFSV4OP_GETDEVINFO, 1, "GetDeviceInfo", 13, },
+	{ NFSV4OP_LAYOUTCOMMIT, 1, "LayoutCommit", 12, },
+	{ NFSV4OP_LAYOUTRETURN, 1, "LayoutReturn", 12, },
 };
 
 
@@ -112,7 +116,8 @@ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0
 };
 
 /*



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