diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_init.c | 10 | ||||
-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 | ||||
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 25 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsubs.c | 25 | ||||
-rw-r--r-- | sys/sys/vnode.h | 15 |
7 files changed, 124 insertions, 8 deletions
diff --git a/sys/kern/vfs_init.c b/sys/kern/vfs_init.c index b829b48..398467d 100644 --- a/sys/kern/vfs_init.c +++ b/sys/kern/vfs_init.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_init.c 8.3 (Berkeley) 1/4/94 - * $Id: vfs_init.c,v 1.5 1994/09/21 03:46:48 wollman Exp $ + * $Id: vfs_init.c,v 1.6 1994/09/22 01:05:09 wollman Exp $ */ @@ -326,3 +326,11 @@ fs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) /* NOTREACHED */ } +/* + * This goop is here to support a loadable NFS module... grumble... + */ +void (*lease_check) __P((struct vnode *, struct proc *, struct ucred *, int)) + = 0; +void (*lease_updatetime) __P((int)) + = 0; + 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 diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 4f6d7e7..cb52f5d 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/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/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 4f6d7e7..cb52f5d 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.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/sys/vnode.h b/sys/sys/vnode.h index db37932..a045607 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vnode.h 8.7 (Berkeley) 2/4/94 - * $Id: vnode.h,v 1.6 1994/09/19 15:41:57 dfr Exp $ + * $Id: vnode.h,v 1.7 1994/09/21 03:47:34 wollman Exp $ */ #ifndef _SYS_VNODE_H_ @@ -230,15 +230,18 @@ extern struct vattr va_null; /* predefined null vattr structure */ #define LEASE_READ 0x1 /* Check lease for readers */ #define LEASE_WRITE 0x2 /* Check lease for modifiers */ +extern void (*lease_check) __P((struct vnode *vp, struct proc *p, + struct ucred *ucred, int flag)); +extern void (*lease_updatetime) __P((int deltat)); + #ifdef NFS -void lease_check __P((struct vnode *vp, struct proc *p, - struct ucred *ucred, int flag)); -void lease_updatetime __P((int deltat)); #define LEASE_CHECK(vp, p, cred, flag) lease_check((vp), (p), (cred), (flag)) #define LEASE_UPDATETIME(dt) lease_updatetime(dt) #else -#define LEASE_CHECK(vp, p, cred, flag) -#define LEASE_UPDATETIME(dt) +#define LEASE_CHECK(vp, p, cred, flag) \ + do { if(lease_check) lease_check((vp), (p), (cred), (flag)); } while(0) +#define LEASE_UPDATETIME(dt) \ + do { if(lease_updatetime) lease_updatetime(dt); } while(0) #endif /* NFS */ #endif /* KERNEL */ |