Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Nov 2011 01:18:48 +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: r227744 - head/sys/fs/nfsclient
Message-ID:  <201111200118.pAK1ImgM068585@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Sun Nov 20 01:18:47 2011
New Revision: 227744
URL: http://svn.freebsd.org/changeset/base/227744

Log:
  Since the nfscl_cleanup() function isn't used by the FreeBSD NFSv4 client,
  delete the code and fix up the related comments. This should not have
  any functional effect on the client.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clstate.c	Sun Nov 20 00:39:15 2011	(r227743)
+++ head/sys/fs/nfsclient/nfs_clstate.c	Sun Nov 20 01:18:47 2011	(r227744)
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
  *     the granularity of the OpenOwner, then code must be added to
  *     serialize Ops on the OpenOwner.)
  * - When to get rid of OpenOwners and LockOwners.
- *   - When a process exits, it calls nfscl_cleanup(), which goes
- *     through the client list looking for all Open and Lock Owners.
+ *   - The function nfscl_cleanup_common() is executed after a process exits.
+ *     It goes through the client list looking for all Open and Lock Owners.
  *     When one is found, it is marked "defunct" or in the case of
  *     an OpenOwner without any Opens, freed.
  *     The renew thread scans for defunct Owners and gets rid of them,
@@ -1630,33 +1630,9 @@ nfscl_expireclient(struct nfsclclient *c
 	}
 }
 
-#ifndef	__FreeBSD__
 /*
- * Called from exit() upon process termination.
- */
-APPLESTATIC void
-nfscl_cleanup(NFSPROC_T *p)
-{
-	struct nfsclclient *clp;
-	u_int8_t own[NFSV4CL_LOCKNAMELEN];
-
-	if (!nfscl_inited)
-		return;
-	nfscl_filllockowner(p->td_proc, own, F_POSIX);
-
-	NFSLOCKCLSTATE();
-	/*
-	 * Loop through all the clientids, looking for the OpenOwners.
-	 */
-	LIST_FOREACH(clp, &nfsclhead, nfsc_list)
-		nfscl_cleanup_common(clp, own);
-	NFSUNLOCKCLSTATE();
-}
-#endif	/* !__FreeBSD__ */
-
-/*
- * Common code used by nfscl_cleanup() and nfscl_cleanupkext().
- * Must be called with CLSTATE lock held.
+ * This function must be called after the process represented by "own" has
+ * exited. Must be called with CLSTATE lock held.
  */
 static void
 nfscl_cleanup_common(struct nfsclclient *clp, u_int8_t *own)
@@ -1707,9 +1683,7 @@ nfscl_cleanup_common(struct nfsclclient 
 
 #if defined(APPLEKEXT) || defined(__FreeBSD__)
 /*
- * Simulate the call nfscl_cleanup() by looking for open owners associated
- * with processes that no longer exist, since a call to nfscl_cleanup()
- * can't be patched into exit().
+ * Find open/lock owners for processes that have exited.
  */
 static void
 nfscl_cleanupkext(struct nfsclclient *clp)
@@ -2556,8 +2530,8 @@ tryagain:
 
 #if defined(APPLEKEXT) || defined(__FreeBSD__)
 		/*
-		 * Simulate the calls to nfscl_cleanup() when a process
-		 * exits, since the call can't be patched into exit().
+		 * Call nfscl_cleanupkext() once per second to check for
+		 * open/lock owners where the process has exited.
 		 */
 		{
 			struct timespec mytime;



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