From owner-svn-src-all@FreeBSD.ORG Sun Nov 20 00:39:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71F4D1065676; Sun, 20 Nov 2011 00:39:15 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6113C8FC14; Sun, 20 Nov 2011 00:39:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pAK0dF8n067270; Sun, 20 Nov 2011 00:39:15 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pAK0dFju067267; Sun, 20 Nov 2011 00:39:15 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201111200039.pAK0dFju067267@svn.freebsd.org> From: Rick Macklem Date: Sun, 20 Nov 2011 00:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227743 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2011 00:39:15 -0000 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);