svn commit: r218714 - stable/8/sys/fs/nfsserver

Zack Kirsch zack at FreeBSD.org
Tue Feb 15 20:46:52 UTC 2011


Author: zack
Date: Tue Feb 15 20:46:51 2011
New Revision: 218714
URL: http://svn.freebsd.org/changeset/base/218714

Log:
  MFC: 217335
  Clean up the experimental NFS server replay cache when the module is unloaded.

Modified:
  stable/8/sys/fs/nfsserver/nfs_nfsdcache.c
  stable/8/sys/fs/nfsserver/nfs_nfsdport.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Feb 15 20:18:52 2011	(r218713)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c	Tue Feb 15 20:46:51 2011	(r218714)
@@ -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: stable/8/sys/fs/nfsserver/nfs_nfsdport.c
==============================================================================
--- stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Tue Feb 15 20:18:52 2011	(r218713)
+++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c	Tue Feb 15 20:46:51 2011	(r218714)
@@ -3117,6 +3117,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