svn commit: r217335 - head/sys/fs/nfsserver

Zack Kirsch zack at FreeBSD.org
Wed Jan 12 23:34:10 UTC 2011


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);


More information about the svn-src-all mailing list