Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2012 00:18:38 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r234689 - projects/nfsv4.1-client/sys/fs/nfsclient
Message-ID:  <201204260018.q3Q0Icu3021429@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Thu Apr 26 00:18:38 2012
New Revision: 234689
URL: http://svn.freebsd.org/changeset/base/234689

Log:
  Add support to the NFSv4.1 PNFS client for returning stale
  layouts.

Modified:
  projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clstate.c

Modified: projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clstate.c	Wed Apr 25 22:44:07 2012	(r234688)
+++ projects/nfsv4.1-client/sys/fs/nfsclient/nfs_clstate.c	Thu Apr 26 00:18:38 2012	(r234689)
@@ -2441,6 +2441,7 @@ nfscl_renewthread(struct nfsclclient *cl
 	struct nfsclflayout *flp;
 	struct nfscldevinfo *dip, *ndip;
 	struct nfscllayouthead rlh;
+	struct nfsclrecalllayout *recallp;
 
 	cred = newnfs_getcred();
 	NFSLOCKCLSTATE();
@@ -2635,7 +2636,6 @@ printf("do layoutcommit\n");
 				TAILQ_INSERT_HEAD(&rlh, lyp, nfsly_list);
 			}
 		}
-#ifdef notyet
 		/* Now, look for stale layouts. */
 		lyp = TAILQ_LAST(&clp->nfsc_layout, nfscllayouthead);
 		while (lyp != NULL) {
@@ -2644,10 +2644,16 @@ printf("do layoutcommit\n");
 			    (lyp->nfsly_flags & NFSLY_RECALL) == 0 &&
 			    lyp->nfsly_refcnt == 0) {
 printf("ret stale lay=%d\n", nfscl_layoutcnt);
+				recallp = malloc(sizeof(*recallp),
+				    M_NFSLAYRECALL, M_NOWAIT);
+				if (recallp == NULL)
+					break;
+				(void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE,
+				    lyp, NFSLAYOUTIOMODE_ANY, 0, UINT64_MAX,
+				    lyp->nfsly_stateid.seqid, recallp);
 			}
 			lyp = nlyp;
 		}
-#endif
 
 		/*
 		 * Free up any unreferenced device info structures.



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