diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2010-09-06 23:44:12 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2010-09-06 23:44:12 +0000 |
commit | 87f3d58d3064a78c9b29faa668f1d98225f01e71 (patch) | |
tree | bbc6c4fb3c1748ac72b8b1b8bab76b4e91896fd0 /sys/msdosfs | |
parent | a41bd31e53cce764c5bc6861ce6be4074cc59551 (diff) |
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/msdosfs')
-rw-r--r-- | sys/msdosfs/msdosfs_denode.c | 7 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 78 |
2 files changed, 40 insertions, 45 deletions
diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index 1166a2d9785..9f52bab9a84 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_denode.c,v 1.38 2010/03/29 23:33:39 krw Exp $ */ +/* $OpenBSD: msdosfs_denode.c,v 1.39 2010/09/06 23:44:10 thib Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */ /*- @@ -168,7 +168,7 @@ deget(struct msdosfsmount *pmp, uint32_t dirclust, uint32_t diroffset, struct denode **depp) { int error; - extern int (**msdosfs_vnodeop_p)(void *); + extern struct vops msdosfs_vops; struct direntry *direntptr; struct denode *ldep; struct vnode *nvp; @@ -211,8 +211,7 @@ retry: * copy it from the passed disk buffer. */ /* getnewvnode() does a vref() on the vnode */ - error = getnewvnode(VT_MSDOSFS, pmp->pm_mountp, - msdosfs_vnodeop_p, &nvp); + error = getnewvnode(VT_MSDOSFS, pmp->pm_mountp, &msdosfs_vops, &nvp); if (error) { *depp = 0; return (error); diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 998d946911d..571d8695bd1 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.72 2009/08/14 11:35:03 jasper Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.73 2010/09/06 23:44:10 thib Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -1729,7 +1729,7 @@ msdosfs_strategy(void *v) vp = dep->de_devvp; bp->b_dev = vp->v_rdev; - VOCALL(vp->v_op, VOFFSET(vop_strategy), ap); + (vp->v_op->vop_strategy)(ap); return (0); } @@ -1815,43 +1815,39 @@ fileidhash(uint64_t fileid) } /* Global vfs data structures for msdosfs */ -int (**msdosfs_vnodeop_p)(void *); -struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { - { &vop_default_desc, eopnotsupp }, - { &vop_lookup_desc, msdosfs_lookup }, - { &vop_create_desc, msdosfs_create }, - { &vop_mknod_desc, msdosfs_mknod }, - { &vop_open_desc, msdosfs_open }, - { &vop_close_desc, msdosfs_close }, - { &vop_access_desc, msdosfs_access }, - { &vop_getattr_desc, msdosfs_getattr }, - { &vop_setattr_desc, msdosfs_setattr }, - { &vop_read_desc, msdosfs_read }, - { &vop_write_desc, msdosfs_write }, - { &vop_ioctl_desc, msdosfs_ioctl }, - { &vop_poll_desc, msdosfs_poll }, - { &vop_fsync_desc, msdosfs_fsync }, - { &vop_remove_desc, msdosfs_remove }, - { &vop_link_desc, msdosfs_link }, - { &vop_rename_desc, msdosfs_rename }, - { &vop_mkdir_desc, msdosfs_mkdir }, - { &vop_rmdir_desc, msdosfs_rmdir }, - { &vop_symlink_desc, msdosfs_symlink }, - { &vop_readdir_desc, msdosfs_readdir }, - { &vop_readlink_desc, msdosfs_readlink }, - { &vop_abortop_desc, vop_generic_abortop }, - { &vop_inactive_desc, msdosfs_inactive }, - { &vop_reclaim_desc, msdosfs_reclaim }, - { &vop_lock_desc, msdosfs_lock }, - { &vop_unlock_desc, msdosfs_unlock }, - { &vop_bmap_desc, msdosfs_bmap }, - { &vop_strategy_desc, msdosfs_strategy }, - { &vop_print_desc, msdosfs_print }, - { &vop_islocked_desc, msdosfs_islocked }, - { &vop_pathconf_desc, msdosfs_pathconf }, - { &vop_advlock_desc, msdosfs_advlock }, - { &vop_bwrite_desc, vop_generic_bwrite }, - { (struct vnodeop_desc *)NULL, (int (*)(void *))NULL } +struct vops msdosfs_vops = { + .vop_default = eopnotsupp, + .vop_lookup = msdosfs_lookup, + .vop_create = msdosfs_create, + .vop_mknod = msdosfs_mknod, + .vop_open = msdosfs_open, + .vop_close = msdosfs_close, + .vop_access = msdosfs_access, + .vop_getattr = msdosfs_getattr, + .vop_setattr = msdosfs_setattr, + .vop_read = msdosfs_read, + .vop_write = msdosfs_write, + .vop_ioctl = msdosfs_ioctl, + .vop_poll = msdosfs_poll, + .vop_fsync = msdosfs_fsync, + .vop_remove = msdosfs_remove, + .vop_link = msdosfs_link, + .vop_rename = msdosfs_rename, + .vop_mkdir = msdosfs_mkdir, + .vop_rmdir = msdosfs_rmdir, + .vop_symlink = msdosfs_symlink, + .vop_readdir = msdosfs_readdir, + .vop_readlink = msdosfs_readlink, + .vop_abortop = vop_generic_abortop, + .vop_inactive = msdosfs_inactive, + .vop_reclaim = msdosfs_reclaim, + .vop_lock = msdosfs_lock, + .vop_unlock = msdosfs_unlock, + .vop_bmap = msdosfs_bmap, + .vop_strategy = msdosfs_strategy, + .vop_print = msdosfs_print, + .vop_islocked = msdosfs_islocked, + .vop_pathconf = msdosfs_pathconf, + .vop_advlock = msdosfs_advlock, + .vop_bwrite = vop_generic_bwrite }; -struct vnodeopv_desc msdosfs_vnodeop_opv_desc = - { &msdosfs_vnodeop_p, msdosfs_vnodeop_entries }; |