union_vnops.c (928e13b6a1d5dfad4ec9640ecbb4ace5a2d3d55f) union_vnops.c (a18ac0ffaf779b2969f54f69e9d82b22377f3be8)
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
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.27 1997/04/21 15:32:24 kato Exp $
38 * $Id: union_vnops.c,v 1.28 1997/04/26 04:09:40 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/time.h>
46#include <sys/stat.h>

--- 1427 unchanged lines hidden (view full) ---

1474start:
1475 un = VTOUNION(vp);
1476
1477 if (un->un_uppervp != NULLVP) {
1478 if (((un->un_flags & UN_ULOCK) == 0) &&
1479 (vp->v_usecount != 0)) {
1480 if (VOP_ISLOCKED(un->un_uppervp)) {
1481 /*
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/time.h>
46#include <sys/stat.h>

--- 1427 unchanged lines hidden (view full) ---

1474start:
1475 un = VTOUNION(vp);
1476
1477 if (un->un_uppervp != NULLVP) {
1478 if (((un->un_flags & UN_ULOCK) == 0) &&
1479 (vp->v_usecount != 0)) {
1480 if (VOP_ISLOCKED(un->un_uppervp)) {
1481 /*
1482 * XXX - Dirty!
1483 * Though UN_ULOCK is not set, upper vnode is locked. This
1484 * indicates a locking violation. If this case happens,
1485 * we will get `lock against myself' panic.
1486 *
1487 * SHOULD BE FIXED! But I couldn't find a fix. If you are
1488 * a kernel hacker, pleas try DIAGNOSTIC kernel, that causes
1489 * panic here.
1482 * Erm, we find race!
1483 * Do nothing here.
1490 */
1491#ifdef DIAGNOSTIC
1492 panic("union_link: upper vnode is locked, "
1493 "but UN_UNLOCK is not set.");
1494#endif
1484 */
1485#ifdef DIAGNOSTIC
1486 panic("union_link: upper vnode is locked, "
1487 "but UN_UNLOCK is not set.");
1488#endif
1495 printf("union_lock: adjust un_flags\n");
1496 un->un_flags |= UN_ULOCK; /* Adjust -- dirty */
1497 } else {
1498 error = vn_lock(un->un_uppervp, flags, p);
1499 if (error)
1500 return (error);
1501 un->un_flags |= UN_ULOCK;
1502 }
1503 }
1504#ifdef DIAGNOSTIC

--- 275 unchanged lines hidden ---
1489 } else {
1490 error = vn_lock(un->un_uppervp, flags, p);
1491 if (error)
1492 return (error);
1493 un->un_flags |= UN_ULOCK;
1494 }
1495 }
1496#ifdef DIAGNOSTIC

--- 275 unchanged lines hidden ---