Made unloading of the nfs LKM sort of work. This is mainly to test
detachment of vfs sysctls. Unloading of vfs LKMs doesn't actually work for any vfs, since it leaves garbage pointers to memory allocation control structures.
This commit is contained in:
parent
73bcd22039
commit
3adc4cd6e2
@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kern_lkm.c,v 1.54 1998/08/15 22:42:20 bde Exp $
|
||||
* $Id: kern_lkm.c,v 1.55 1998/09/05 17:13:27 bde Exp $
|
||||
*/
|
||||
|
||||
#include "opt_devfs.h"
|
||||
@ -615,8 +615,7 @@ _lkm_vfs(lkmtp, cmd)
|
||||
struct sysctl_oid **oidpp;
|
||||
struct vfsconf *vfc = args->lkm_vfsconf;
|
||||
struct vfsconf *vfsp, *prev_vfsp;
|
||||
int i, maxtypenum;
|
||||
int err = 0;
|
||||
int error, i, maxtypenum;
|
||||
|
||||
switch(cmd) {
|
||||
case LKM_E_LOAD:
|
||||
@ -683,6 +682,12 @@ _lkm_vfs(lkmtp, cmd)
|
||||
return EBUSY;
|
||||
}
|
||||
|
||||
if (vfc->vfc_vfsops->vfs_uninit != NULL) {
|
||||
error = (*vfc->vfc_vfsops->vfs_uninit)(vfsp);
|
||||
if (error)
|
||||
return (error);
|
||||
}
|
||||
|
||||
prev_vfsp->vfc_next = vfsp->vfc_next;
|
||||
|
||||
if (vfsp->vfc_vfsops->vfs_oid != NULL) {
|
||||
@ -712,7 +717,7 @@ _lkm_vfs(lkmtp, cmd)
|
||||
case LKM_E_STAT: /* no special handling... */
|
||||
break;
|
||||
}
|
||||
return(err);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
||||
* $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
|
||||
* $Id: nfs.h,v 1.43 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
@ -314,6 +314,8 @@ MALLOC_DECLARE(M_NFSHASH);
|
||||
extern vm_zone_t nfsmount_zone;
|
||||
#endif
|
||||
|
||||
extern struct callout_handle nfs_timer_handle;
|
||||
|
||||
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
|
||||
|
||||
/*
|
||||
@ -584,6 +586,7 @@ extern int nfs_debug;
|
||||
|
||||
u_quad_t nfs_curusec __P((void));
|
||||
int nfs_init __P((struct vfsconf *vfsp));
|
||||
int nfs_uninit __P((struct vfsconf *vfsp));
|
||||
int nfs_reply __P((struct nfsreq *));
|
||||
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
|
||||
int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.63 1998/06/21 12:50:12 bde Exp $
|
||||
* $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -110,7 +110,16 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
static void (*nfs_prev_lease_updatetime) __P((int));
|
||||
static int nfs_prev_nfssvc_sy_narg;
|
||||
static sy_call_t *nfs_prev_nfssvc_sy_call;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
|
||||
static vop_t *nfs_prev_vop_lease_check;
|
||||
static int nfs_prev_getfh_sy_narg;
|
||||
static sy_call_t *nfs_prev_getfh_sy_call;
|
||||
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -1161,26 +1170,50 @@ nfs_init(vfsp)
|
||||
|
||||
nfs_timer(0);
|
||||
|
||||
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_vop_lease_check = default_vnodeop_p[VOFFSET(vop_lease)];
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = (vop_t *)nqnfs_vop_lease_check;
|
||||
#endif
|
||||
nfs_prev_lease_updatetime = lease_updatetime;
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsp->vfc_refcount++; /* make us non-unloadable */
|
||||
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;
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_getfh_sy_narg = sysent[SYS_getfh].sy_narg;
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
nfs_prev_getfh_sy_call = sysent[SYS_getfh].sy_call;
|
||||
sysent[SYS_getfh].sy_call = (sy_call_t *)getfh;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
nfs_uninit(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
{
|
||||
|
||||
untimeout(nfs_timer, (void *)NULL, nfs_timer_handle);
|
||||
nfs_mount_type = -1;
|
||||
#ifndef NFS_NOSERVER
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = nfs_prev_vop_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_prev_lease_updatetime;
|
||||
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
|
||||
sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = nfs_prev_getfh_sy_narg;
|
||||
sysent[SYS_getfh].sy_call = nfs_prev_getfh_sy_call;
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attribute cache routines.
|
||||
* nfs_loadattrcache() - loads or updates the cache contents from attributes
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
|
||||
* $Id: nfs_socket.c,v 1.43 1998/08/01 09:04:02 peter Exp $
|
||||
* $Id: nfs_socket.c,v 1.44 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -133,6 +133,7 @@ static int proct[NFS_NPROCS] = {
|
||||
static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, };
|
||||
int nfsrtton = 0;
|
||||
struct nfsrtt nfsrtt;
|
||||
struct callout_handle nfs_timer_handle;
|
||||
|
||||
static int nfs_msg __P((struct proc *,char *,char *));
|
||||
static int nfs_rcvlock __P((struct nfsreq *));
|
||||
@ -1464,7 +1465,7 @@ nfs_timer(arg)
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
splx(s);
|
||||
timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.63 1998/06/21 12:50:12 bde Exp $
|
||||
* $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -110,7 +110,16 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
static void (*nfs_prev_lease_updatetime) __P((int));
|
||||
static int nfs_prev_nfssvc_sy_narg;
|
||||
static sy_call_t *nfs_prev_nfssvc_sy_call;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
|
||||
static vop_t *nfs_prev_vop_lease_check;
|
||||
static int nfs_prev_getfh_sy_narg;
|
||||
static sy_call_t *nfs_prev_getfh_sy_call;
|
||||
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -1161,26 +1170,50 @@ nfs_init(vfsp)
|
||||
|
||||
nfs_timer(0);
|
||||
|
||||
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_vop_lease_check = default_vnodeop_p[VOFFSET(vop_lease)];
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = (vop_t *)nqnfs_vop_lease_check;
|
||||
#endif
|
||||
nfs_prev_lease_updatetime = lease_updatetime;
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsp->vfc_refcount++; /* make us non-unloadable */
|
||||
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;
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_getfh_sy_narg = sysent[SYS_getfh].sy_narg;
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
nfs_prev_getfh_sy_call = sysent[SYS_getfh].sy_call;
|
||||
sysent[SYS_getfh].sy_call = (sy_call_t *)getfh;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
nfs_uninit(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
{
|
||||
|
||||
untimeout(nfs_timer, (void *)NULL, nfs_timer_handle);
|
||||
nfs_mount_type = -1;
|
||||
#ifndef NFS_NOSERVER
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = nfs_prev_vop_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_prev_lease_updatetime;
|
||||
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
|
||||
sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = nfs_prev_getfh_sy_narg;
|
||||
sysent[SYS_getfh].sy_call = nfs_prev_getfh_sy_call;
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attribute cache routines.
|
||||
* nfs_loadattrcache() - loads or updates the cache contents from attributes
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
|
||||
* $Id: nfs_vfsops.c,v 1.73 1998/08/12 20:17:42 bde Exp $
|
||||
* $Id: nfs_vfsops.c,v 1.74 1998/09/05 17:13:28 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -132,7 +132,7 @@ static struct vfsops nfs_vfsops = {
|
||||
nfs_fhtovp,
|
||||
nfs_vptofh,
|
||||
nfs_init,
|
||||
0,
|
||||
nfs_uninit,
|
||||
&sysctl___vfs_nfs
|
||||
};
|
||||
VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, VFCF_NETWORK);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
||||
* $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
|
||||
* $Id: nfs.h,v 1.43 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
@ -314,6 +314,8 @@ MALLOC_DECLARE(M_NFSHASH);
|
||||
extern vm_zone_t nfsmount_zone;
|
||||
#endif
|
||||
|
||||
extern struct callout_handle nfs_timer_handle;
|
||||
|
||||
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
|
||||
|
||||
/*
|
||||
@ -584,6 +586,7 @@ extern int nfs_debug;
|
||||
|
||||
u_quad_t nfs_curusec __P((void));
|
||||
int nfs_init __P((struct vfsconf *vfsp));
|
||||
int nfs_uninit __P((struct vfsconf *vfsp));
|
||||
int nfs_reply __P((struct nfsreq *));
|
||||
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
|
||||
int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
|
||||
* $Id: nfs_socket.c,v 1.43 1998/08/01 09:04:02 peter Exp $
|
||||
* $Id: nfs_socket.c,v 1.44 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -133,6 +133,7 @@ static int proct[NFS_NPROCS] = {
|
||||
static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, };
|
||||
int nfsrtton = 0;
|
||||
struct nfsrtt nfsrtt;
|
||||
struct callout_handle nfs_timer_handle;
|
||||
|
||||
static int nfs_msg __P((struct proc *,char *,char *));
|
||||
static int nfs_rcvlock __P((struct nfsreq *));
|
||||
@ -1464,7 +1465,7 @@ nfs_timer(arg)
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
splx(s);
|
||||
timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.63 1998/06/21 12:50:12 bde Exp $
|
||||
* $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -110,7 +110,16 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
static void (*nfs_prev_lease_updatetime) __P((int));
|
||||
static int nfs_prev_nfssvc_sy_narg;
|
||||
static sy_call_t *nfs_prev_nfssvc_sy_call;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
|
||||
static vop_t *nfs_prev_vop_lease_check;
|
||||
static int nfs_prev_getfh_sy_narg;
|
||||
static sy_call_t *nfs_prev_getfh_sy_call;
|
||||
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -1161,26 +1170,50 @@ nfs_init(vfsp)
|
||||
|
||||
nfs_timer(0);
|
||||
|
||||
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_vop_lease_check = default_vnodeop_p[VOFFSET(vop_lease)];
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = (vop_t *)nqnfs_vop_lease_check;
|
||||
#endif
|
||||
nfs_prev_lease_updatetime = lease_updatetime;
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsp->vfc_refcount++; /* make us non-unloadable */
|
||||
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;
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_getfh_sy_narg = sysent[SYS_getfh].sy_narg;
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
nfs_prev_getfh_sy_call = sysent[SYS_getfh].sy_call;
|
||||
sysent[SYS_getfh].sy_call = (sy_call_t *)getfh;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
nfs_uninit(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
{
|
||||
|
||||
untimeout(nfs_timer, (void *)NULL, nfs_timer_handle);
|
||||
nfs_mount_type = -1;
|
||||
#ifndef NFS_NOSERVER
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = nfs_prev_vop_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_prev_lease_updatetime;
|
||||
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
|
||||
sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = nfs_prev_getfh_sy_narg;
|
||||
sysent[SYS_getfh].sy_call = nfs_prev_getfh_sy_call;
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attribute cache routines.
|
||||
* nfs_loadattrcache() - loads or updates the cache contents from attributes
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95
|
||||
* $Id: nfs_vfsops.c,v 1.73 1998/08/12 20:17:42 bde Exp $
|
||||
* $Id: nfs_vfsops.c,v 1.74 1998/09/05 17:13:28 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -132,7 +132,7 @@ static struct vfsops nfs_vfsops = {
|
||||
nfs_fhtovp,
|
||||
nfs_vptofh,
|
||||
nfs_init,
|
||||
0,
|
||||
nfs_uninit,
|
||||
&sysctl___vfs_nfs
|
||||
};
|
||||
VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, VFCF_NETWORK);
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
||||
* $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
|
||||
* $Id: nfs.h,v 1.43 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
@ -314,6 +314,8 @@ MALLOC_DECLARE(M_NFSHASH);
|
||||
extern vm_zone_t nfsmount_zone;
|
||||
#endif
|
||||
|
||||
extern struct callout_handle nfs_timer_handle;
|
||||
|
||||
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
|
||||
|
||||
/*
|
||||
@ -584,6 +586,7 @@ extern int nfs_debug;
|
||||
|
||||
u_quad_t nfs_curusec __P((void));
|
||||
int nfs_init __P((struct vfsconf *vfsp));
|
||||
int nfs_uninit __P((struct vfsconf *vfsp));
|
||||
int nfs_reply __P((struct nfsreq *));
|
||||
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
|
||||
int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
||||
* $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
|
||||
* $Id: nfs.h,v 1.43 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
@ -314,6 +314,8 @@ MALLOC_DECLARE(M_NFSHASH);
|
||||
extern vm_zone_t nfsmount_zone;
|
||||
#endif
|
||||
|
||||
extern struct callout_handle nfs_timer_handle;
|
||||
|
||||
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
|
||||
|
||||
/*
|
||||
@ -584,6 +586,7 @@ extern int nfs_debug;
|
||||
|
||||
u_quad_t nfs_curusec __P((void));
|
||||
int nfs_init __P((struct vfsconf *vfsp));
|
||||
int nfs_uninit __P((struct vfsconf *vfsp));
|
||||
int nfs_reply __P((struct nfsreq *));
|
||||
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
|
||||
int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
||||
* $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
|
||||
* $Id: nfs.h,v 1.43 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
@ -314,6 +314,8 @@ MALLOC_DECLARE(M_NFSHASH);
|
||||
extern vm_zone_t nfsmount_zone;
|
||||
#endif
|
||||
|
||||
extern struct callout_handle nfs_timer_handle;
|
||||
|
||||
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
|
||||
|
||||
/*
|
||||
@ -584,6 +586,7 @@ extern int nfs_debug;
|
||||
|
||||
u_quad_t nfs_curusec __P((void));
|
||||
int nfs_init __P((struct vfsconf *vfsp));
|
||||
int nfs_uninit __P((struct vfsconf *vfsp));
|
||||
int nfs_reply __P((struct nfsreq *));
|
||||
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
|
||||
int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_socket.c 8.5 (Berkeley) 3/30/95
|
||||
* $Id: nfs_socket.c,v 1.43 1998/08/01 09:04:02 peter Exp $
|
||||
* $Id: nfs_socket.c,v 1.44 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -133,6 +133,7 @@ static int proct[NFS_NPROCS] = {
|
||||
static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, };
|
||||
int nfsrtton = 0;
|
||||
struct nfsrtt nfsrtt;
|
||||
struct callout_handle nfs_timer_handle;
|
||||
|
||||
static int nfs_msg __P((struct proc *,char *,char *));
|
||||
static int nfs_rcvlock __P((struct nfsreq *));
|
||||
@ -1464,7 +1465,7 @@ nfs_timer(arg)
|
||||
}
|
||||
#endif /* NFS_NOSERVER */
|
||||
splx(s);
|
||||
timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
nfs_timer_handle = timeout(nfs_timer, (void *)0, nfs_ticks);
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
|
||||
* $Id: nfs_subs.c,v 1.63 1998/06/21 12:50:12 bde Exp $
|
||||
* $Id: nfs_subs.c,v 1.64 1998/09/05 15:17:33 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -110,7 +110,16 @@ struct nqtimerhead nqtimerhead;
|
||||
struct nqfhhashhead *nqfhhashtbl;
|
||||
u_long nqfhhash;
|
||||
|
||||
static void (*nfs_prev_lease_updatetime) __P((int));
|
||||
static int nfs_prev_nfssvc_sy_narg;
|
||||
static sy_call_t *nfs_prev_nfssvc_sy_call;
|
||||
|
||||
#ifndef NFS_NOSERVER
|
||||
|
||||
static vop_t *nfs_prev_vop_lease_check;
|
||||
static int nfs_prev_getfh_sy_narg;
|
||||
static sy_call_t *nfs_prev_getfh_sy_call;
|
||||
|
||||
/*
|
||||
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
|
||||
*/
|
||||
@ -1161,26 +1170,50 @@ nfs_init(vfsp)
|
||||
|
||||
nfs_timer(0);
|
||||
|
||||
|
||||
/*
|
||||
* Set up lease_check and lease_updatetime so that other parts
|
||||
* of the system can call us, if we are loadable.
|
||||
*/
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_vop_lease_check = default_vnodeop_p[VOFFSET(vop_lease)];
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = (vop_t *)nqnfs_vop_lease_check;
|
||||
#endif
|
||||
nfs_prev_lease_updatetime = lease_updatetime;
|
||||
lease_updatetime = nfs_lease_updatetime;
|
||||
vfsp->vfc_refcount++; /* make us non-unloadable */
|
||||
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;
|
||||
#ifndef NFS_NOSERVER
|
||||
nfs_prev_getfh_sy_narg = sysent[SYS_getfh].sy_narg;
|
||||
sysent[SYS_getfh].sy_narg = 2;
|
||||
nfs_prev_getfh_sy_call = sysent[SYS_getfh].sy_call;
|
||||
sysent[SYS_getfh].sy_call = (sy_call_t *)getfh;
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
nfs_uninit(vfsp)
|
||||
struct vfsconf *vfsp;
|
||||
{
|
||||
|
||||
untimeout(nfs_timer, (void *)NULL, nfs_timer_handle);
|
||||
nfs_mount_type = -1;
|
||||
#ifndef NFS_NOSERVER
|
||||
default_vnodeop_p[VOFFSET(vop_lease)] = nfs_prev_vop_lease_check;
|
||||
#endif
|
||||
lease_updatetime = nfs_prev_lease_updatetime;
|
||||
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
|
||||
sysent[SYS_nfssvc].sy_call = nfs_prev_nfssvc_sy_call;
|
||||
#ifndef NFS_NOSERVER
|
||||
sysent[SYS_getfh].sy_narg = nfs_prev_getfh_sy_narg;
|
||||
sysent[SYS_getfh].sy_call = nfs_prev_getfh_sy_call;
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Attribute cache routines.
|
||||
* nfs_loadattrcache() - loads or updates the cache contents from attributes
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs.h 8.4 (Berkeley) 5/1/95
|
||||
* $Id: nfs.h,v 1.42 1998/06/30 11:19:22 jmg Exp $
|
||||
* $Id: nfs.h,v 1.43 1998/08/23 03:07:16 wollman Exp $
|
||||
*/
|
||||
|
||||
#ifndef _NFS_NFS_H_
|
||||
@ -314,6 +314,8 @@ MALLOC_DECLARE(M_NFSHASH);
|
||||
extern vm_zone_t nfsmount_zone;
|
||||
#endif
|
||||
|
||||
extern struct callout_handle nfs_timer_handle;
|
||||
|
||||
struct uio; struct buf; struct vattr; struct nameidata; /* XXX */
|
||||
|
||||
/*
|
||||
@ -584,6 +586,7 @@ extern int nfs_debug;
|
||||
|
||||
u_quad_t nfs_curusec __P((void));
|
||||
int nfs_init __P((struct vfsconf *vfsp));
|
||||
int nfs_uninit __P((struct vfsconf *vfsp));
|
||||
int nfs_reply __P((struct nfsreq *));
|
||||
int nfs_getreq __P((struct nfsrv_descript *,struct nfsd *,int));
|
||||
int nfs_send __P((struct socket *, struct sockaddr *, struct mbuf *,
|
||||
|
Loading…
Reference in New Issue
Block a user