Date: Fri, 28 Jul 2006 20:11:12 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 102681 for review Message-ID: <200607282011.k6SKBCUb081229@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=102681 Change 102681 by jhb@jhb_mutex on 2006/07/28 20:10:27 Use NOSTD / syscall_register() to register nfssvc. Fix audit event (its AUE_NFS_SVC rather than AUE_NFSSVC). Affected files ... .. //depot/projects/smpng/sys/kern/syscalls.master#81 edit .. //depot/projects/smpng/sys/nfsserver/nfs_srvsubs.c#33 edit Differences ... ==== //depot/projects/smpng/sys/kern/syscalls.master#81 (text+ko) ==== @@ -299,7 +299,7 @@ 153 AUE_NULL UNIMPL asyncdaemon (BSD/OS 2.x) 154 AUE_NULL UNIMPL nosys ; 155 is initialized by the NFS code, if present. -155 AUE_NFSSVC NOIMPL { int nfssvc(int flag, caddr_t argp); } +155 AUE_NFS_SVC NOSTD { int nfssvc(int flag, caddr_t argp); } 156 AUE_GETDIRENTRIES COMPAT { int getdirentries(int fd, char *buf, \ u_int count, long *basep); } 157 AUE_STATFS COMPAT4 { int statfs(char *path, \ ==== //depot/projects/smpng/sys/nfsserver/nfs_srvsubs.c#33 (text+ko) ==== @@ -98,8 +98,13 @@ 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; +static struct sysent nfssvc_sysent = { + sizeof(struct nfssvc_args) / sizeof(register_t), + (sy_call_t *)&nfssvc, + AUE_NFS_SVC +}; struct mtx nfsd_mtx; @@ -554,11 +559,8 @@ 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; + (void)syscall_register(&nfssvc_offset, &nfssvc_sysent, + &nfssvc_prev_sysent); break; case MOD_UNLOAD: @@ -568,8 +570,7 @@ } callout_stop(&nfsrv_callout); - sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg; - sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call; + syscall_deregister(&nfssvc_offset, &nfssvc_prev_sysent); mtx_destroy(&nfsd_mtx); break; default:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200607282011.k6SKBCUb081229>