Clean up the experimental NFS server replay cache when the module is unloaded.

Reviewed by:    rmacklem
Approved by:    zml (mentor)
This commit is contained in:
Zack Kirsch 2011-01-12 23:34:09 +00:00
parent 7f903d33f0
commit 52776c502b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=217335
2 changed files with 5 additions and 3 deletions

View File

@ -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.

View File

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