diff options
author | mckusick <mckusick@FreeBSD.org> | 1999-06-16 23:27:55 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 1999-06-16 23:27:55 +0000 |
commit | 88e39a63db386a8e7939538fd1b350cbe663486b (patch) | |
tree | 002e7a32883a2178dd2164b02c296d429dee5cfd /sys/fs | |
parent | 97a0215ac1c4c057e39723365f18d612e9304581 (diff) | |
download | FreeBSD-src-88e39a63db386a8e7939538fd1b350cbe663486b.zip FreeBSD-src-88e39a63db386a8e7939538fd1b350cbe663486b.tar.gz |
Add a vnode argument to VOP_BWRITE to get rid of the last vnode
operator special case. Delete special case code from vnode_if.sh,
vnode_if.src, umap_vnops.c, and null_vnops.c.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 58 | ||||
-rw-r--r-- | sys/fs/umapfs/umap_vnops.c | 48 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 17 |
3 files changed, 8 insertions, 115 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index db5c341..fdcdc38 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -37,11 +37,11 @@ * * Ancestors: * @(#)lofs_vnops.c 1.2 (Berkeley) 6/18/92 - * $Id: null_vnops.c,v 1.31 1999/01/27 22:42:06 dillon Exp $ + * $Id: null_vnops.c,v 1.32 1999/01/28 00:57:50 dillon Exp $ * ...and... * @(#)null_vnodeops.c 1.20 92/07/07 UCLA Ficus project * - * $Id: null_vnops.c,v 1.31 1999/01/27 22:42:06 dillon Exp $ + * $Id: null_vnops.c,v 1.32 1999/01/28 00:57:50 dillon Exp $ */ /* @@ -192,7 +192,6 @@ SYSCTL_INT(_debug, OID_AUTO, nullfs_bug_bypass, CTLFLAG_RW, &null_bug_bypass, 0, ""); static int null_access __P((struct vop_access_args *ap)); -static int null_bwrite __P((struct vop_bwrite_args *ap)); static int null_getattr __P((struct vop_getattr_args *ap)); static int null_inactive __P((struct vop_inactive_args *ap)); static int null_lock __P((struct vop_lock_args *ap)); @@ -200,7 +199,6 @@ static int null_lookup __P((struct vop_lookup_args *ap)); static int null_print __P((struct vop_print_args *ap)); static int null_reclaim __P((struct vop_reclaim_args *ap)); static int null_setattr __P((struct vop_setattr_args *ap)); -static int null_strategy __P((struct vop_strategy_args *ap)); static int null_unlock __P((struct vop_unlock_args *ap)); /* @@ -595,63 +593,12 @@ null_print(ap) } /* - * XXX - vop_strategy must be hand coded because it has no - * vnode in its arguments. - * This goes away with a merged VM/buffer cache. - */ -static int -null_strategy(ap) - struct vop_strategy_args /* { - struct buf *a_bp; - } */ *ap; -{ - struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = NULLVPTOLOWERVP(bp->b_vp); - - error = VOP_STRATEGY(bp->b_vp, bp); - - bp->b_vp = savedvp; - - return (error); -} - -/* - * XXX - like vop_strategy, vop_bwrite must be hand coded because it has no - * vnode in its arguments. - * This goes away with a merged VM/buffer cache. - */ -static int -null_bwrite(ap) - struct vop_bwrite_args /* { - struct buf *a_bp; - } */ *ap; -{ - struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = NULLVPTOLOWERVP(bp->b_vp); - - error = VOP_BWRITE(bp); - - bp->b_vp = savedvp; - - return (error); -} - -/* * Global vfs data structures */ vop_t **null_vnodeop_p; static struct vnodeopv_entry_desc null_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) null_bypass }, { &vop_access_desc, (vop_t *) null_access }, - { &vop_bwrite_desc, (vop_t *) null_bwrite }, { &vop_getattr_desc, (vop_t *) null_getattr }, { &vop_inactive_desc, (vop_t *) null_inactive }, { &vop_lock_desc, (vop_t *) null_lock }, @@ -659,7 +606,6 @@ static struct vnodeopv_entry_desc null_vnodeop_entries[] = { { &vop_print_desc, (vop_t *) null_print }, { &vop_reclaim_desc, (vop_t *) null_reclaim }, { &vop_setattr_desc, (vop_t *) null_setattr }, - { &vop_strategy_desc, (vop_t *) null_strategy }, { &vop_unlock_desc, (vop_t *) null_unlock }, { NULL, NULL } }; diff --git a/sys/fs/umapfs/umap_vnops.c b/sys/fs/umapfs/umap_vnops.c index 893e1e5..eff7841 100644 --- a/sys/fs/umapfs/umap_vnops.c +++ b/sys/fs/umapfs/umap_vnops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)umap_vnops.c 8.6 (Berkeley) 5/22/95 - * $Id: umap_vnops.c,v 1.25 1998/07/30 17:40:45 bde Exp $ + * $Id: umap_vnops.c,v 1.26 1998/12/07 21:58:34 archie Exp $ */ /* @@ -57,7 +57,6 @@ static int umap_bug_bypass = 0; /* for debugging: enables bypass printf'ing */ SYSCTL_INT(_debug, OID_AUTO, umapfs_bug_bypass, CTLFLAG_RW, &umap_bug_bypass, 0, ""); -static int umap_bwrite __P((struct vop_bwrite_args *ap)); static int umap_bypass __P((struct vop_generic_args *ap)); static int umap_getattr __P((struct vop_getattr_args *ap)); static int umap_inactive __P((struct vop_inactive_args *ap)); @@ -65,7 +64,6 @@ static int umap_lock __P((struct vop_lock_args *ap)); static int umap_print __P((struct vop_print_args *ap)); static int umap_reclaim __P((struct vop_reclaim_args *ap)); static int umap_rename __P((struct vop_rename_args *ap)); -static int umap_strategy __P((struct vop_strategy_args *ap)); static int umap_unlock __P((struct vop_unlock_args *ap)); /* @@ -433,48 +431,6 @@ umap_reclaim(ap) } static int -umap_strategy(ap) - struct vop_strategy_args /* { - struct vnode *a_vp; - struct buf *a_bp; - } */ *ap; -{ - struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = UMAPVPTOLOWERVP(bp->b_vp); - - error = VOP_STRATEGY(bp->b_vp, ap->a_bp); - - bp->b_vp = savedvp; - - return (error); -} - -static int -umap_bwrite(ap) - struct vop_bwrite_args /* { - struct buf *a_bp; - } */ *ap; -{ - struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = UMAPVPTOLOWERVP(bp->b_vp); - - error = VOP_BWRITE(ap->a_bp); - - bp->b_vp = savedvp; - - return (error); -} - - -static int umap_print(ap) struct vop_print_args /* { struct vnode *a_vp; @@ -549,14 +505,12 @@ umap_rename(ap) vop_t **umap_vnodeop_p; static struct vnodeopv_entry_desc umap_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) umap_bypass }, - { &vop_bwrite_desc, (vop_t *) umap_bwrite }, { &vop_getattr_desc, (vop_t *) umap_getattr }, { &vop_inactive_desc, (vop_t *) umap_inactive }, { &vop_lock_desc, (vop_t *) umap_lock }, { &vop_print_desc, (vop_t *) umap_print }, { &vop_reclaim_desc, (vop_t *) umap_reclaim }, { &vop_rename_desc, (vop_t *) umap_rename }, - { &vop_strategy_desc, (vop_t *) umap_strategy }, { &vop_unlock_desc, (vop_t *) umap_unlock }, { NULL, NULL } }; diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index ba9b2a3..6b9681c 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.59 1998/12/14 05:00:59 dillon Exp $ + * $Id: union_vnops.c,v 1.60 1999/01/27 22:42:08 dillon Exp $ */ #include <sys/param.h> @@ -1734,24 +1734,17 @@ union_strategy(ap) } */ *ap; { struct buf *bp = ap->a_bp; - int error; - struct vnode *savedvp; - - savedvp = bp->b_vp; - bp->b_vp = OTHERVP(bp->b_vp); + struct vnode *othervp = OTHERVP(bp->b_vp); #ifdef DIAGNOSTIC - if (bp->b_vp == NULLVP) + if (othervp == NULLVP) panic("union_strategy: nil vp"); if (((bp->b_flags & B_READ) == 0) && - (bp->b_vp == LOWERVP(savedvp))) + (othervp == LOWERVP(bp->b_vp))) panic("union_strategy: writing to lowervp"); #endif - error = VOP_STRATEGY(bp->b_vp, bp); - bp->b_vp = savedvp; - - return (error); + return (VOP_STRATEGY(othervp, bp)); } /* |