diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2007-04-02 13:53:26 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2007-04-02 13:53:26 +0000 |
| commit | ddda35b8f6e8e19330a383f856c0775c092b3cbc (patch) | |
| tree | c3eb704274d5952e90c05e45007954674e3d3208 /sys/nfsserver | |
| parent | ebb3c22c16bfe12ccb584e4b3abb5ea13fbe289a (diff) | |
Notes
Diffstat (limited to 'sys/nfsserver')
| -rw-r--r-- | sys/nfsserver/nfs_srvsubs.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index b064fb32e633..374bf267718a 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -98,8 +98,9 @@ int nfssvc_sockhead_flag; struct nfsd_head nfsd_head; int nfsd_head_flag; -static int nfs_prev_nfssvc_sy_narg; -static sy_call_t *nfs_prev_nfssvc_sy_call; +static int nfssvc_offset = SYS_nfssvc; +static struct sysent nfssvc_prev_sysent; +MAKE_SYSENT(nfssvc); struct mtx nfsd_mtx; @@ -522,6 +523,7 @@ static const short *nfsrv_v3errmap[] = { static int nfsrv_modevent(module_t mod, int type, void *data) { + static int registered; int error = 0; NET_LOCK_GIANT(); @@ -554,11 +556,11 @@ nfsrv_modevent(module_t mod, int type, void *data) NFSD_UNLOCK(); nfsrv_timer(0); - /* XXX: Should use SYSCALL_MODULE() */ - nfs_prev_nfssvc_sy_narg = sysent[SYS_nfssvc].sy_narg; - sysent[SYS_nfssvc].sy_narg = 2; - nfs_prev_nfssvc_sy_call = sysent[SYS_nfssvc].sy_call; - sysent[SYS_nfssvc].sy_call = (sy_call_t *)nfssvc; + error = syscall_register(&nfssvc_offset, &nfssvc_sysent, + &nfssvc_prev_sysent); + if (error) + break; + registered = 1; break; case MOD_UNLOAD: @@ -567,9 +569,10 @@ nfsrv_modevent(module_t mod, int type, void *data) break; } + if (registered) + syscall_deregister(&nfssvc_offset, &nfssvc_prev_sysent); 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 */ nfsrv_destroycache(); /* Free the server request cache */ mtx_destroy(&nfsd_mtx); break; |
