diff options
author | wollman <wollman@FreeBSD.org> | 1994-09-22 22:10:49 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-09-22 22:10:49 +0000 |
commit | d8d853f4faa49b727dd68f09116d9978dea80f30 (patch) | |
tree | c43434ec2d5649116c2c25d2a3bae6252459a4ba /sys/nfs | |
parent | 66d4416828530fb477c0acb17362f18714151de3 (diff) | |
download | FreeBSD-src-d8d853f4faa49b727dd68f09116d9978dea80f30.zip FreeBSD-src-d8d853f4faa49b727dd68f09116d9978dea80f30.tar.gz |
Make NFS loadable.
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_common.c | 25 | ||||
-rw-r--r-- | sys/nfs/nfs_subs.c | 25 | ||||
-rw-r--r-- | sys/nfs/nqnfs.h | 7 |
3 files changed, 56 insertions, 1 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index 4f6d7e7..cb52f5d 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -52,6 +52,10 @@ #include <sys/mbuf.h> #include <sys/socket.h> #include <sys/stat.h> +#ifdef VFS_LKM +#include <sys/sysent.h> +#include <sys/syscall.h> +#endif #include <nfs/rpcv2.h> #include <nfs/nfsv2.h> @@ -97,6 +101,13 @@ extern int nqsrv_clockskew; extern int nqsrv_writeslack; extern int nqsrv_maxlease; +#ifdef VFS_LKM +struct getfh_args; +extern int getfh(struct proc *, struct getfh_args *, int *); +struct nfssvc_args; +extern int nfssvc(struct proc *, struct nfssvc_args *, int *); +#endif + /* * Create the header for an rpc request packet * The hsiz is the size of the rest of the nfs request header. @@ -634,6 +645,20 @@ nfs_init() nfsreqh.r_prev = nfsreqh.r_next = &nfsreqh; nfs_timer(); + /* + * Set up lease_check and lease_updatetime so that other parts + * of the system can call us, if we are loadable. + */ + lease_check = nfs_lease_check; + lease_updatetime = nfs_lease_updatetime; + vfsconf[MOUNT_NFS]->vfc_refcount++; /* make us non-unloadable */ +#ifdef VFS_LKM + sysent[SYS_nfssvc].sy_narg = 2; + sysent[SYS_nfssvc].sy_call = nfssvc; + sysent[SYS_getfh].sy_narg = 2; + sysent[SYS_getfh].sy_call = getfh; +#endif + return (0); } diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 4f6d7e7..cb52f5d 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -52,6 +52,10 @@ #include <sys/mbuf.h> #include <sys/socket.h> #include <sys/stat.h> +#ifdef VFS_LKM +#include <sys/sysent.h> +#include <sys/syscall.h> +#endif #include <nfs/rpcv2.h> #include <nfs/nfsv2.h> @@ -97,6 +101,13 @@ extern int nqsrv_clockskew; extern int nqsrv_writeslack; extern int nqsrv_maxlease; +#ifdef VFS_LKM +struct getfh_args; +extern int getfh(struct proc *, struct getfh_args *, int *); +struct nfssvc_args; +extern int nfssvc(struct proc *, struct nfssvc_args *, int *); +#endif + /* * Create the header for an rpc request packet * The hsiz is the size of the rest of the nfs request header. @@ -634,6 +645,20 @@ nfs_init() nfsreqh.r_prev = nfsreqh.r_next = &nfsreqh; nfs_timer(); + /* + * Set up lease_check and lease_updatetime so that other parts + * of the system can call us, if we are loadable. + */ + lease_check = nfs_lease_check; + lease_updatetime = nfs_lease_updatetime; + vfsconf[MOUNT_NFS]->vfc_refcount++; /* make us non-unloadable */ +#ifdef VFS_LKM + sysent[SYS_nfssvc].sy_narg = 2; + sysent[SYS_nfssvc].sy_call = nfssvc; + sysent[SYS_getfh].sy_narg = 2; + sysent[SYS_getfh].sy_call = getfh; +#endif + return (0); } diff --git a/sys/nfs/nqnfs.h b/sys/nfs/nqnfs.h index 2189109..1c9de12 100644 --- a/sys/nfs/nqnfs.h +++ b/sys/nfs/nqnfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nqnfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nqnfs.h,v 1.2 1994/08/02 07:52:28 davidg Exp $ + * $Id: nqnfs.h,v 1.3 1994/08/21 06:50:14 paul Exp $ */ #ifndef _NFS_NQNFS_H_ @@ -201,4 +201,9 @@ extern u_long nqfheadhash; #define NQNFS_TRYLATER 501 #define NQNFS_AUTHERR 502 +#ifdef KERNEL +void nfs_lease_check __P((struct vnode *, struct proc *, struct ucred *, int)); +void nfs_lease_updatetime __P((int)); +#endif + #endif |