1/*
2 * Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
3 * Copyright (c) 1992, 1993, 1994, 1995
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *
--- 21 unchanged lines hidden (view full) ---
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
38 * $Id: union_vnops.c,v 1.57 1998/05/07 04:58:38 msmith Exp $
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/proc.h>
44#include <sys/fcntl.h>
45#include <sys/stat.h>
46#include <sys/kernel.h>
--- 1673 unchanged lines hidden (view full) ---
1720/*
1721 * XXX - vop_strategy must be hand coded because it has no
1722 * vnode in its arguments.
1723 * This goes away with a merged VM/buffer cache.
1724 */
1725static int
1726union_strategy(ap)
1727 struct vop_strategy_args /* {
1728 struct vnode *a_vp;
1729 struct buf *a_bp;
1730 } */ *ap;
1731{
1732 struct buf *bp = ap->a_bp;
1733 int error;
1734 struct vnode *savedvp;
1735
1736 savedvp = bp->b_vp;
1737 bp->b_vp = OTHERVP(bp->b_vp);
1738
1739#ifdef DIAGNOSTIC
1740 if (bp->b_vp == NULLVP)
1741 panic("union_strategy: nil vp");
1742 if (((bp->b_flags & B_READ) == 0) &&
1743 (bp->b_vp == LOWERVP(savedvp)))
1744 panic("union_strategy: writing to lowervp");
1745#endif
1746
1747 error = VOP_STRATEGY(bp->b_vp, bp);
1748 bp->b_vp = savedvp;
1749
1750 return (error);
1751}
1752
1753/*
1754 * Global vfs data structures
1755 */
--- 45 unchanged lines hidden ---
2 * Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
3 * Copyright (c) 1992, 1993, 1994, 1995
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *
--- 21 unchanged lines hidden (view full) ---
30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
38 * $Id: union_vnops.c,v 1.57 1998/05/07 04:58:38 msmith Exp $
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/proc.h>
44#include <sys/fcntl.h>
45#include <sys/stat.h>
46#include <sys/kernel.h>
--- 1673 unchanged lines hidden (view full) ---
1720/*
1721 * XXX - vop_strategy must be hand coded because it has no
1722 * vnode in its arguments.
1723 * This goes away with a merged VM/buffer cache.
1724 */
1725static int
1726union_strategy(ap)
1727 struct vop_strategy_args /* {
1728 struct vnode *a_vp;
1729 struct buf *a_bp;
1730 } */ *ap;
1731{
1732 struct buf *bp = ap->a_bp;
1733 int error;
1734 struct vnode *savedvp;
1735
1736 savedvp = bp->b_vp;
1737 bp->b_vp = OTHERVP(bp->b_vp);
1738
1739#ifdef DIAGNOSTIC
1740 if (bp->b_vp == NULLVP)
1741 panic("union_strategy: nil vp");
1742 if (((bp->b_flags & B_READ) == 0) &&
1743 (bp->b_vp == LOWERVP(savedvp)))
1744 panic("union_strategy: writing to lowervp");
1745#endif
1746
1747 error = VOP_STRATEGY(bp->b_vp, bp);
1748 bp->b_vp = savedvp;
1749
1750 return (error);
1751}
1752
1753/*
1754 * Global vfs data structures
1755 */
--- 45 unchanged lines hidden ---