summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzack <zack@FreeBSD.org>2011-01-12 23:34:09 +0000
committerzack <zack@FreeBSD.org>2011-01-12 23:34:09 +0000
commit5b6f95e9fa8b1f428b858a24e0e5577b1d549df4 (patch)
tree7c67a3d922f1460497459c80fa2d22c921f7f2c6
parent63bb91c48d2f927d64dc4b433ec2d935b1ff6314 (diff)
downloadFreeBSD-src-5b6f95e9fa8b1f428b858a24e0e5577b1d549df4.zip
FreeBSD-src-5b6f95e9fa8b1f428b858a24e0e5577b1d549df4.tar.gz
Clean up the experimental NFS server replay cache when the module is unloaded.
Reviewed by: rmacklem Approved by: zml (mentor)
-rw-r--r--sys/fs/nfsserver/nfs_nfsdcache.c4
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdcache.c b/sys/fs/nfsserver/nfs_nfsdcache.c
index b91229f..bcffd6c 100644
--- a/sys/fs/nfsserver/nfs_nfsdcache.c
+++ b/sys/fs/nfsserver/nfs_nfsdcache.c
@@ -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.
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 71d68ea..efa7ff4 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -3078,6 +3078,10 @@ nfsd_modevent(module_t mod, int type, void *data)
#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);
OpenPOWER on IntegriCloud