summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-08-08 00:34:39 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-08-08 00:34:39 +0000
commita54bf8de952ccdc7011b84e89eeb6f39a7f54b81 (patch)
tree63eb03044181363e25f6397d01094238416762d9 /sys
parent694ca2f6f019ef4dcbeca7a6b9422999812090de (diff)
From NetBSD; vdevgone, used for revoking access to device nodes when they
disappear (detach is coming).
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_subr.c19
-rw-r--r--sys/sys/vnode.h3
2 files changed, 20 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index a44fa140711..ff120b78e79 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.39 1999/05/31 17:34:48 millert Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.40 1999/08/08 00:34:38 niklas Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1214,6 +1214,23 @@ vfinddev(dev, type, vpp)
}
/*
+ * Revoke all the vnodes corresponding to the specified minor number
+ * range (endpoints inclusive) of the specified major.
+ */
+void
+vdevgone(maj, minl, minh, type)
+ int maj, minl, minh;
+ enum vtype type;
+{
+ struct vnode *vp;
+ int mn;
+
+ for (mn = minl; mn <= minh; mn++)
+ if (vfinddev(makedev(maj, mn), type, &vp))
+ VOP_REVOKE(vp, REVOKEALL);
+}
+
+/*
* Calculate the total number of references to a special device.
*/
int
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 89cbb8119e6..6ade92117cf 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.20 1999/02/26 02:48:36 art Exp $ */
+/* $OpenBSD: vnode.h,v 1.21 1999/08/08 00:34:38 niklas Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -464,6 +464,7 @@ int vflush __P((struct mount *mp, struct vnode *vp, int flags));
void vntblinit __P((void));
void vn_initialize_syncerd __P((void));
void vwakeup __P((struct buf *));
+void vdevgone __P((int, int, int, enum vtype));
int vget __P((struct vnode *vp, int lockflag, struct proc *p));
void vgone __P((struct vnode *vp));
void vgonel __P((struct vnode *, struct proc *));