svn commit: r234689 - projects/nfsv4.1-client/sys/fs/nfsclient
Rick Macklem
rmacklem at FreeBSD.org
Thu Apr 26 00:18:38 UTC 2012
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.
More information about the svn-src-projects
mailing list