Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jan 2011 23:34:09 +0000 (UTC)
From:      Zack Kirsch <zack@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217335 - head/sys/fs/nfsserver
Message-ID:  <201101122334.p0CNY9BD025731@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zack
Date: Wed Jan 12 23:34:09 2011
New Revision: 217335
URL: http://svn.freebsd.org/changeset/base/217335

Log:
  Clean up the experimental NFS server replay cache when the module is unloaded.
  
  Reviewed by:    rmacklem
  Approved by:    zml (mentor)

Modified:
  head/sys/fs/nfsserver/nfs_nfsdcache.c
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdcache.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdcache.c	Wed Jan 12 23:31:28 2011	(r217334)
+++ head/sys/fs/nfsserver/nfs_nfsdcache.c	Wed Jan 12 23:34:09 2011	(r217335)
@@ -727,9 +727,8 @@ nfsrc_freecache(struct nfsrvcache *rp)
 	newnfsstats.srvcache_size--;
 }
 
-#ifdef notdef
 /*
- * Clean out the cache. Called when the last nfsd terminates.
+ * Clean out the cache. Called when nfsserver module is unloaded.
  */
 APPLESTATIC void
 nfsrvd_cleancache(void)
@@ -752,7 +751,6 @@ nfsrvd_cleancache(void)
 	nfsrc_tcpsavedreplies = 0;
 	NFSUNLOCKCACHE();
 }
-#endif	/* notdef */
 
 /*
  * The basic rule is to get rid of entries that are expired.

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- head/sys/fs/nfsserver/nfs_nfsdport.c	Wed Jan 12 23:31:28 2011	(r217334)
+++ head/sys/fs/nfsserver/nfs_nfsdport.c	Wed Jan 12 23:34:09 2011	(r217335)
@@ -3078,6 +3078,10 @@ nfsd_modevent(module_t mod, int type, vo
 #endif
 		nfsd_call_servertimer = NULL;
 		nfsd_call_nfsd = NULL;
+
+		/* Clean the NFS server reply cache */
+		nfsrvd_cleancache();
+
 		/* and get rid of the locks */
 		mtx_destroy(&nfs_cache_mutex);
 		mtx_destroy(&nfs_v4root_mutex);



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