diff options
author | 2010-09-06 23:44:10 +0000 | |
---|---|---|
committer | 2010-09-06 23:44:10 +0000 | |
commit | 57593ff0414b90ebf400de19b45bbeaee8108cfb (patch) | |
tree | 13b193c37171e2c724599f8763f09db45d6275b8 /sys/kern/vfs_subr.c | |
parent | All PWR_{SUSPEND,RESUME} can now be replaced by DVACT_{SUSPEND,RESUME} (diff) | |
download | wireguard-openbsd-57593ff0414b90ebf400de19b45bbeaee8108cfb.tar.xz wireguard-openbsd-57593ff0414b90ebf400de19b45bbeaee8108cfb.zip |
End the VOP experiment. Instead of the ridicolusly complicated operation
vector setup that has questionable features (that have, as far as I can
tell never been used in practice, atleast not in OpenBSD), remove all
the gunk and favor a simple struct full of function pointers that get
set directly by each of the filesystems.
Removes gobs of ugly code and makes things simpler by a magnitude.
The only downside of this is that we loose the vnoperate feature so
the spec/fifo operations of the filesystems need to be kept in sync
with specfs and fifofs, this is no big deal as the API it self is pretty
static.
Many thanks to armani@ who pulled an earlier version of this diff to
current after c2k10 and Gabriel Kihlman on tech@ for testing.
Liked by many. "come on, find your balls" deraadt@.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 9de92d955a1..f8b89c02730 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.189 2010/08/12 15:00:17 oga Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.190 2010/09/06 23:44:10 thib Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -301,14 +301,13 @@ vattr_null(struct vattr *vap) /* * Routines having to do with the management of the vnode table. */ -extern int (**dead_vnodeop_p)(void *); long numvnodes; /* * Return the next vnode from the free list. */ int -getnewvnode(enum vtagtype tag, struct mount *mp, int (**vops)(void *), +getnewvnode(enum vtagtype tag, struct mount *mp, struct vops *vops, struct vnode **vpp) { struct proc *p = curproc; @@ -464,7 +463,7 @@ getdevvp(dev_t dev, struct vnode **vpp, enum vtype type) *vpp = NULLVP; return (0); } - error = getnewvnode(VT_NON, NULL, spec_vnodeop_p, &nvp); + error = getnewvnode(VT_NON, NULL, &spec_vops, &nvp); if (error) { *vpp = NULLVP; return (error); @@ -861,7 +860,7 @@ vflush_vnode(struct vnode *vp, void *arg) { vgonel(vp, p); } else { vclean(vp, 0, p); - vp->v_op = spec_vnodeop_p; + vp->v_op = &spec_vops; insmntque(vp, (struct mount *)0); } return (0); @@ -967,7 +966,7 @@ vclean(struct vnode *vp, int flags, struct proc *p) /* * Done with purge, notify sleepers of the grim news. */ - vp->v_op = dead_vnodeop_p; + vp->v_op = &dead_vops; VN_KNOTE(vp, NOTE_REVOKE); vp->v_tag = VT_NON; vp->v_flag &= ~VXLOCK; |