Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2011 00:39:15 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227743 - in head/sys/fs: nfs nfsclient
Message-ID:  <201111200039.pAK0dFju067267@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Nov 20 00:39:15 2011
New Revision: 227743
URL: http://svn.freebsd.org/changeset/base/227743

Log:
  Post r223774 the NFSv4 client never uses the linked list with the
  head nfsc_defunctlockowner. This patch simply removes the code that
  loops through this always empty list, since the code no longer does
  anything useful. It should not have any effect on the client's
  behaviour.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfs/nfsclstate.h
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfs/nfsclstate.h
==============================================================================
--- head/sys/fs/nfs/nfsclstate.h	Sat Nov 19 22:14:08 2011	(r227742)
+++ head/sys/fs/nfs/nfsclstate.h	Sun Nov 20 00:39:15 2011	(r227743)
@@ -48,7 +48,6 @@ struct nfsclclient {
 	struct nfsclownerhead	nfsc_owner;
 	struct nfscldeleghead	nfsc_deleg;
 	struct nfscldeleghash	nfsc_deleghash[NFSCLDELEGHASHSIZE];
-	struct nfscllockownerhead nfsc_defunctlockowner;
 	struct nfsv4lock nfsc_lock;
 	struct proc	*nfsc_renewthread;
 	struct nfsmount	*nfsc_nmp;

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Sat Nov 19 22:14:08 2011	(r227742)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Sun Nov 20 00:39:15 2011	(r227743)
@@ -699,7 +699,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
 {
 	struct nfsclclient *clp;
 	struct nfsclclient *newclp = NULL;
-	struct nfscllockowner *lp, *nlp;
 	struct mount *mp;
 	struct nfsmount *nmp;
 	char uuid[HOSTUUIDLEN];
@@ -744,7 +743,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
 		TAILQ_INIT(&clp->nfsc_deleg);
 		for (i = 0; i < NFSCLDELEGHASHSIZE; i++)
 			LIST_INIT(&clp->nfsc_deleghash[i]);
-		LIST_INIT(&clp->nfsc_defunctlockowner);
 		clp->nfsc_flags = NFSCLFLAGS_INITED;
 		clp->nfsc_clientidrev = 1;
 		clp->nfsc_cbident = nfscl_nextcbident();
@@ -793,11 +791,6 @@ nfscl_getcl(vnode_t vp, struct ucred *cr
 			NFSUNLOCKCLSTATE();
 			return (EACCES);
 		}
-		/* get rid of defunct lockowners */
-		LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list,
-		    nlp) {
-			nfscl_freelockowner(lp, 0);
-		}
 		/*
 		 * If RFC3530 Sec. 14.2.33 is taken literally,
 		 * NFSERR_CLIDINUSE will be returned persistently for the
@@ -1537,13 +1530,6 @@ nfscl_cleanclient(struct nfsclclient *cl
 {
 	struct nfsclowner *owp, *nowp;
 	struct nfsclopen *op, *nop;
-	struct nfscllockowner *lp, *nlp;
-
-
-	/* get rid of defunct lockowners */
-	LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, nlp) {
-		nfscl_freelockowner(lp, 0);
-	}
 
 	/* Now, all the OpenOwners, etc. */
 	LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) {
@@ -1717,12 +1703,6 @@ nfscl_cleanup_common(struct nfsclclient 
 		}
 		owp = nowp;
 	}
-
-	/* and check the defunct list */
-	LIST_FOREACH(lp, &clp->nfsc_defunctlockowner, nfsl_list) {
-		if (!NFSBCMP(lp->nfsl_owner, own, NFSV4CL_LOCKNAMELEN))
-		    lp->nfsl_defunct = 1;
-	}
 }
 
 #if defined(APPLEKEXT) || defined(__FreeBSD__)
@@ -1735,7 +1715,6 @@ static void
 nfscl_cleanupkext(struct nfsclclient *clp)
 {
 	struct nfsclowner *owp, *nowp;
-	struct nfscllockowner *lp;
 
 	NFSPROCLISTLOCK();
 	NFSLOCKCLSTATE();
@@ -1743,12 +1722,6 @@ nfscl_cleanupkext(struct nfsclclient *cl
 		if (nfscl_procdoesntexist(owp->nfsow_owner))
 			nfscl_cleanup_common(clp, owp->nfsow_owner);
 	}
-
-	/* and check the defunct list */
-	LIST_FOREACH(lp, &clp->nfsc_defunctlockowner, nfsl_list) {
-		if (nfscl_procdoesntexist(lp->nfsl_owner))
-			lp->nfsl_defunct = 1;
-	}
 	NFSUNLOCKCLSTATE();
 	NFSPROCLISTUNLOCK();
 }
@@ -1905,11 +1878,6 @@ nfscl_recover(struct nfsclclient *clp, s
 	NFSUNLOCKREQ();
 	splx(s);
 
-	/* get rid of defunct lockowners */
-	LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list, nlp) {
-		nfscl_freelockowner(lp, 0);
-	}
-
 	/*
 	 * Now, mark all delegations "need reclaim".
 	 */
@@ -2157,7 +2125,6 @@ nfscl_recover(struct nfsclclient *clp, s
 APPLESTATIC int
 nfscl_hasexpired(struct nfsclclient *clp, u_int32_t clidrev, NFSPROC_T *p)
 {
-	struct nfscllockowner *lp, *nlp;
 	struct nfsmount *nmp;
 	struct ucred *cred;
 	int igotlock = 0, error, trycnt;
@@ -2207,12 +2174,6 @@ nfscl_hasexpired(struct nfsclclient *clp
 		clp->nfsc_flags &= ~(NFSCLFLAGS_HASCLIENTID |
 		    NFSCLFLAGS_RECOVER);
 	} else {
-		/* get rid of defunct lockowners */
-		LIST_FOREACH_SAFE(lp, &clp->nfsc_defunctlockowner, nfsl_list,
-		    nlp) {
-			nfscl_freelockowner(lp, 0);
-		}
-
 		/*
 		 * Expire the state for the client.
 		 */
@@ -2486,25 +2447,6 @@ nfscl_renewthread(struct nfsclclient *cl
 		    owp = nowp;
 		}
 
-		/* also search the defunct list */
-		lp = LIST_FIRST(&clp->nfsc_defunctlockowner);
-		while (lp != NULL) {
-		    nlp = LIST_NEXT(lp, nfsl_list);
-		    if (lp->nfsl_defunct) {
-			LIST_FOREACH(olp, &lh, nfsl_list) {
-			    if (!NFSBCMP(olp->nfsl_owner, lp->nfsl_owner,
-				NFSV4CL_LOCKNAMELEN))
-				break;
-			}
-			if (olp == NULL) {
-			    LIST_REMOVE(lp, nfsl_list);
-			    LIST_INSERT_HEAD(&lh, lp, nfsl_list);
-			} else {
-			    nfscl_freelockowner(lp, 0);
-			}
-		    }
-		    lp = nlp;
-		}
 		/* and release defunct lock owners */
 		LIST_FOREACH_SAFE(lp, &lh, nfsl_list, nlp) {
 		    nfscl_freelockowner(lp, 0);



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