Simplify the lease_check stuff.

This commit is contained in:
Poul-Henning Kamp 1997-10-26 20:26:33 +00:00
parent 5ebdb94a1b
commit 1b09ae776d
4 changed files with 12 additions and 45 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)kern_time.c 8.1 (Berkeley) 6/10/93
* $Id: kern_time.c,v 1.36 1997/10/15 13:58:52 peter Exp $
* $Id: kern_time.c,v 1.37 1997/10/20 18:43:49 ache Exp $
*/
#include <sys/param.h>
@ -64,6 +64,14 @@ static int nanosleep1 __P((struct proc *p, struct timespec *rqt,
static int settime __P((struct timeval *));
static void timevalfix __P((struct timeval *));
static void
no_lease_updatetime(deltat)
int deltat;
{
}
void (*lease_updatetime) __P((int)) = no_lease_updatetime;
static int
settime(tv)
struct timeval *tv;
@ -110,9 +118,7 @@ settime(tv)
if (p->p_sleepend)
timevaladd(p->p_sleepend, &delta);
}
#ifdef NFS
lease_updatetime(delta.tv_sec);
#endif
splx(s);
resettodr();
return (0);

View File

@ -64,7 +64,7 @@ static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
{ &vop_fsync_desc, (vop_t *) vop_null },
{ &vop_ioctl_desc, (vop_t *) vop_enotty },
{ &vop_islocked_desc, (vop_t *) vop_noislocked },
{ &vop_lease_desc, (vop_t *) lease_check },
{ &vop_lease_desc, (vop_t *) vop_null },
{ &vop_lock_desc, (vop_t *) vop_nolock },
{ &vop_mmap_desc, (vop_t *) vop_einval },
{ &vop_open_desc, (vop_t *) vop_null },

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_init.c 8.3 (Berkeley) 1/4/94
* $Id: vfs_init.c,v 1.29 1997/10/12 20:24:24 phk Exp $
* $Id: vfs_init.c,v 1.30 1997/10/16 10:47:57 phk Exp $
*/
@ -266,31 +266,3 @@ vfsinit(dummy)
maxvfsconf = maxtypenum;
}
/*
* kernel related system variables.
*/
/*
* This goop is here to support a loadable NFS module... grumble...
*
* XXX: NFS could plug this into default_vnodeop_p now!
*/
int (*lease_check_hook) __P((struct vop_lease_args *))
= 0;
void (*lease_updatetime) __P((int))
= 0;
int
lease_check(ap)
struct vop_lease_args /* {
struct vnode *a_vp;
struct proc *a_p;
struct ucred *a_cred;
int a_flag;
} */ *ap;
{
if (lease_check_hook)
return (*lease_check_hook)(ap);
else
return 0;
}

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
* $Id: vnode.h,v 1.52 1997/10/16 20:32:33 phk Exp $
* $Id: vnode.h,v 1.53 1997/10/17 12:36:18 phk Exp $
*/
#ifndef _SYS_VNODE_H_
@ -261,17 +261,6 @@ extern struct vattr va_null; /* predefined null vattr structure */
extern void (*lease_updatetime) __P((int deltat));
#ifdef NFS
#ifdef NQNFS
#define LEASE_UPDATETIME(dt) lease_updatetime(dt)
#else
#define LEASE_UPDATETIME(dt)
#endif /* NQNFS */
#else
#define LEASE_UPDATETIME(dt) \
do { if(lease_updatetime) lease_updatetime(dt); } while(0)
#endif /* NFS */
#define VSHOULDFREE(vp) \
(!((vp)->v_flag & (VFREE|VDOOMED)) && \
!(vp)->v_holdcnt && !(vp)->v_usecount)