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.56 1998/03/17 08:47:50 kato 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 buf *a_bp;
1729 } */ *ap;
1730{
1731 struct buf *bp = ap->a_bp;
1732 int error;
1733 struct vnode *savedvp;
1734
1735 savedvp = bp->b_vp;
1736 bp->b_vp = OTHERVP(bp->b_vp);
1737
1738#ifdef DIAGNOSTIC
1739 if (bp->b_vp == NULLVP)
1740 panic("union_strategy: nil vp");
1741 if (((bp->b_flags & B_READ) == 0) &&
1742 (bp->b_vp == LOWERVP(savedvp)))
1743 panic("union_strategy: writing to lowervp");
1744#endif
1745
1746 error = VOP_STRATEGY(bp);
1747 bp->b_vp = savedvp;
1748
1749 return (error);
1750}
1751
1752/*
1753 * Global vfs data structures
1754 */
--- 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.56 1998/03/17 08:47:50 kato 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 buf *a_bp;
1729 } */ *ap;
1730{
1731 struct buf *bp = ap->a_bp;
1732 int error;
1733 struct vnode *savedvp;
1734
1735 savedvp = bp->b_vp;
1736 bp->b_vp = OTHERVP(bp->b_vp);
1737
1738#ifdef DIAGNOSTIC
1739 if (bp->b_vp == NULLVP)
1740 panic("union_strategy: nil vp");
1741 if (((bp->b_flags & B_READ) == 0) &&
1742 (bp->b_vp == LOWERVP(savedvp)))
1743 panic("union_strategy: writing to lowervp");
1744#endif
1745
1746 error = VOP_STRATEGY(bp);
1747 bp->b_vp = savedvp;
1748
1749 return (error);
1750}
1751
1752/*
1753 * Global vfs data structures
1754 */
--- 45 unchanged lines hidden ---