summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2011-11-20 01:18:47 +0000
committerrmacklem <rmacklem@FreeBSD.org>2011-11-20 01:18:47 +0000
commite81c24c8baa4708ab717531d4e959b48ba6d32a1 (patch)
tree74124e54d9380d1ac397c78e4e3c5fb211bb2497
parentfe8742b921461e3f5ead974e8b994a5bfe5ed994 (diff)
downloadFreeBSD-src-e81c24c8baa4708ab717531d4e959b48ba6d32a1.zip
FreeBSD-src-e81c24c8baa4708ab717531d4e959b48ba6d32a1.tar.gz
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
-rw-r--r--sys/fs/nfsclient/nfs_clstate.c40
1 files changed, 7 insertions, 33 deletions
diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c
index 30c4ffb..03b412b 100644
--- a/sys/fs/nfsclient/nfs_clstate.c
+++ b/sys/fs/nfsclient/nfs_clstate.c
@@ -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 *clp, struct nfsmount *nmp,
}
}
-#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 *clp, u_int8_t *own)
#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;
OpenPOWER on IntegriCloud