Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jan 2012 05:04:47 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r230606 - in projects/nfsv4.1-client/sys/fs: nfs nfsclient
Message-ID:  <201201270504.q0R54lps022235@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Fri Jan 27 05:04:47 2012
New Revision: 230606
URL: http://svn.freebsd.org/changeset/base/230606

Log:
  Add a RECLAIM_COMPLETE RPC to the NFSv4.1 client, since it is
  required by the server in the Linux 3.n kernel server.

Modified:
  projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c
  projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h
  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
  projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c	Fri Jan 27 02:46:12 2012	(r230605)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_commonsubs.c	Fri Jan 27 05:04:47 2012	(r230606)
@@ -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 };
 
 /* local functions */
 static int nfsrv_skipace(struct nfsrv_descript *nd, int *acesizep);

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h	Fri Jan 27 02:46:12 2012	(r230605)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfs_var.h	Fri Jan 27 05:04:47 2012	(r230606)
@@ -454,6 +454,7 @@ int nfsrpc_layoutcommit(vnode_t, off_t, 
     struct ucred *, NFSPROC_T *, void *);
 int nfsrpc_layoutreturn(vnode_t, int, int, int, int, off_t, uint64_t,
     nfsv4stateid_t *, int, uint32_t *, struct ucred *, NFSPROC_T *, void *);
+int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *);
 
 /* nfs_clstate.c */
 int nfscl_open(vnode_t, u_int8_t *, int, u_int32_t, int,

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfsport.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfsport.h	Fri Jan 27 02:46:12 2012	(r230605)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsport.h	Fri Jan 27 05:04:47 2012	(r230606)
@@ -347,11 +347,12 @@
 #define	NFSPROC_GETDEVICEINFO	47
 #define	NFSPROC_LAYOUTCOMMIT	48
 #define	NFSPROC_LAYOUTRETURN	49
+#define	NFSPROC_RECLAIMCOMPL	50
 
 /*
  * Must be defined as one higher than the last NFSv4.1 Proc# above.
  */
-#define	NFSV41_NPROCS		50
+#define	NFSV41_NPROCS		51
 
 #endif	/* NFS_V3NPROCS */
 

Modified: projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h	Fri Jan 27 02:46:12 2012	(r230605)
+++ projects/nfsv4.1-client/sys/fs/nfs/nfsproto.h	Fri Jan 27 05:04:47 2012	(r230606)
@@ -280,11 +280,12 @@
 #define	NFSPROC_GETDEVICEINFO	47
 #define	NFSPROC_LAYOUTCOMMIT	48
 #define	NFSPROC_LAYOUTRETURN	49
+#define	NFSPROC_RECLAIMCOMPL	50
 
 /*
  * Must be defined as one higher than the last NFSv4.1 Proc# above.
  */
-#define	NFSV41_NPROCS		50
+#define	NFSV41_NPROCS		51
 
 #endif	/* NFS_V3NPROCS */
 

Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c	Fri Jan 27 02:46:12 2012	(r230605)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clcomsubs.c	Fri Jan 27 05:04:47 2012	(r230606)
@@ -108,6 +108,7 @@ static struct {
 	{ NFSV4OP_GETDEVINFO, 1, "GetDeviceInfo", 13, },
 	{ NFSV4OP_LAYOUTCOMMIT, 1, "LayoutCommit", 12, },
 	{ NFSV4OP_LAYOUTRETURN, 1, "LayoutReturn", 12, },
+	{ NFSV4OP_RECLAIMCOMPL, 1, "ReclaimComplete", 15, },
 };
 
 
@@ -117,7 +118,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
 };
 
 /*

Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c	Fri Jan 27 02:46:12 2012	(r230605)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clrpcops.c	Fri Jan 27 05:04:47 2012	(r230606)
@@ -803,6 +803,9 @@ if (error) printf("exch=%d\n",error);
 			error = nfsrpc_createsession(nmp, &nmp->nm_sess, cred,
 			    p);
 if (error) printf("aft crs=%d\n",error);
+		if (error == 0)
+			error = nfsrpc_reclaimcomplete(nmp, cred, p);
+if (error) printf("aft reclcom=%d\n",error);
 		return (error);
 	}
 	nfscl_reqstart(nd, NFSPROC_SETCLIENTID, nmp, NULL, 0, NULL, NULL);
@@ -5021,3 +5024,27 @@ nfsrpc_fillsa(struct nfsmount *nmp, stru
 	return (error);
 }
 
+/*
+ * Do the NFSv4.1 Reclaim Complete.
+ */
+int
+nfsrpc_reclaimcomplete(struct nfsmount *nmp, struct ucred *cred, NFSPROC_T *p)
+{
+	uint32_t *tl;
+	struct nfsrv_descript nfsd;
+	struct nfsrv_descript *nd = &nfsd;
+	int error;
+
+	nfscl_reqstart(nd, NFSPROC_RECLAIMCOMPL, nmp, NULL, 0, NULL, NULL);
+	NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED);
+	*tl = newnfs_false;
+	nd->nd_flag |= ND_USEGSSNAME;
+	error = newnfs_request(nd, nmp, NULL, &nmp->nm_sockreq, NULL, p, cred,
+	    NFS_PROG, NFS_VER4, NULL, 1, NULL, NULL);
+	if (error != 0)
+		return (error);
+	error = nd->nd_repstat;
+	mbuf_freem(nd->nd_mrep);
+	return (error);
+}
+



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