summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver/nfs_srvsubs.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-08-01 16:27:14 +0000
committerjhb <jhb@FreeBSD.org>2006-08-01 16:27:14 +0000
commit4dc640e56e164af7bfa43acfe36b6a8037512f66 (patch)
tree37dd7fcc8f2e00c87c785f35c3c31843f7eb1b29 /sys/nfsserver/nfs_srvsubs.c
parentdcdaa35dc670769cb6106cbfd637c36bbb1422f3 (diff)
downloadFreeBSD-src-4dc640e56e164af7bfa43acfe36b6a8037512f66.zip
FreeBSD-src-4dc640e56e164af7bfa43acfe36b6a8037512f66.tar.gz
- Add a new function nfsrv_destroycache() to tear down the server request
cache when unloading the nfsserver module. This fixes a memory leak and a stale pointer. - Use callout_drain() rather than callout_stop() when unloading the nfsserver module. MFC after: 3 days
Diffstat (limited to 'sys/nfsserver/nfs_srvsubs.c')
-rw-r--r--sys/nfsserver/nfs_srvsubs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index de2b7af..a6bcb8ea 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -567,9 +567,10 @@ nfsrv_modevent(module_t mod, int type, void *data)
break;
}
- callout_stop(&nfsrv_callout);
+ callout_drain(&nfsrv_callout);
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call;
+ nfsrv_destroycache(); /* Free the server request cache */
mtx_destroy(&nfsd_mtx);
break;
default:
OpenPOWER on IntegriCloud