From 631f8d666632c2cab7124690f77c6ad0e1341671 Mon Sep 17 00:00:00 2001 From: kstailey Date: Sat, 4 Jan 1997 17:10:03 +0000 Subject: [PATCH] spec_advlock() via lf_advlock() --- sys/kern/spec_vnops.c | 11 +++++------ sys/kern/vfs_subr.c | 1 + sys/miscfs/specfs/spec_vnops.c | 11 +++++------ sys/miscfs/specfs/specdev.h | 4 +++- sys/sys/specdev.h | 4 +++- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c index 35d3d301038..321e910cd1b 100644 --- a/sys/kern/spec_vnops.c +++ b/sys/kern/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.8 1996/12/22 16:05:24 kstailey Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.9 1997/01/04 17:10:04 kstailey Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -50,6 +50,7 @@ #include #include #include +#include #include @@ -715,12 +716,10 @@ spec_advlock(v) struct flock *a_fl; int a_flags; } */ *ap = v; + register struct vnode *vp = ap->a_vp; - /* XXX Should call lf_advlock() from here, but no snode. */ - /* Instead call through non-special file on same filesystem. */ - - return (VCALL(ap->a_vp->v_mount->mnt_vnodelist.lh_first, - VOFFSET(vop_advlock), ap)); + return (lf_advlock(&vp->v_speclockf, (off_t)0, ap->a_id, + ap->a_op, ap->a_fl, ap->a_flags)); } /* diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 888163257e4..41ea7f092dc 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -708,6 +708,7 @@ loop: nvp->v_hashchain = vpp; nvp->v_specnext = *vpp; nvp->v_specflags = 0; + nvp->v_speclockf = NULL; *vpp = nvp; if (vp != NULL) { nvp->v_flag |= VALIASED; diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 35d3d301038..321e910cd1b 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.8 1996/12/22 16:05:24 kstailey Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.9 1997/01/04 17:10:04 kstailey Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -50,6 +50,7 @@ #include #include #include +#include #include @@ -715,12 +716,10 @@ spec_advlock(v) struct flock *a_fl; int a_flags; } */ *ap = v; + register struct vnode *vp = ap->a_vp; - /* XXX Should call lf_advlock() from here, but no snode. */ - /* Instead call through non-special file on same filesystem. */ - - return (VCALL(ap->a_vp->v_mount->mnt_vnodelist.lh_first, - VOFFSET(vop_advlock), ap)); + return (lf_advlock(&vp->v_speclockf, (off_t)0, ap->a_id, + ap->a_op, ap->a_fl, ap->a_flags)); } /* diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index 3a9729abb1d..9f58fa7acb4 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specdev.h,v 1.2 1996/02/27 08:05:17 niklas Exp $ */ +/* $OpenBSD: specdev.h,v 1.3 1997/01/04 17:10:05 kstailey Exp $ */ /* $NetBSD: specdev.h,v 1.12 1996/02/13 13:13:01 mycroft Exp $ */ /* @@ -46,6 +46,7 @@ struct specinfo { struct vnode *si_specnext; long si_flags; dev_t si_rdev; + struct lockf *si_lockf; }; /* * Exported shorthand @@ -54,6 +55,7 @@ struct specinfo { #define v_hashchain v_specinfo->si_hashchain #define v_specnext v_specinfo->si_specnext #define v_specflags v_specinfo->si_flags +#define v_speclockf v_specinfo->si_lockf /* * Flags for specinfo diff --git a/sys/sys/specdev.h b/sys/sys/specdev.h index 3a9729abb1d..9f58fa7acb4 100644 --- a/sys/sys/specdev.h +++ b/sys/sys/specdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specdev.h,v 1.2 1996/02/27 08:05:17 niklas Exp $ */ +/* $OpenBSD: specdev.h,v 1.3 1997/01/04 17:10:05 kstailey Exp $ */ /* $NetBSD: specdev.h,v 1.12 1996/02/13 13:13:01 mycroft Exp $ */ /* @@ -46,6 +46,7 @@ struct specinfo { struct vnode *si_specnext; long si_flags; dev_t si_rdev; + struct lockf *si_lockf; }; /* * Exported shorthand @@ -54,6 +55,7 @@ struct specinfo { #define v_hashchain v_specinfo->si_hashchain #define v_specnext v_specinfo->si_specnext #define v_specflags v_specinfo->si_flags +#define v_speclockf v_specinfo->si_lockf /* * Flags for specinfo -- 2.20.1