union_vnops.c (afc2a5581f0e5c56b435ec75be096105b6063129) union_vnops.c (471f80601f7f74d0ec1df03a839c8aa55498ad36)
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.46 1997/10/26 20:55:26 phk Exp $
38 * $Id: union_vnops.c,v 1.47 1998/01/18 07:56:41 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>

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

1606 panic("union: unlock unlocked node");
1607 if (curproc && un->un_pid != curproc->p_pid &&
1608 curproc->p_pid > -1 && un->un_pid > -1)
1609 panic("union: unlocking other process's union node");
1610#endif
1611
1612 un->un_flags &= ~UN_LOCKED;
1613
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>

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

1606 panic("union: unlock unlocked node");
1607 if (curproc && un->un_pid != curproc->p_pid &&
1608 curproc->p_pid > -1 && un->un_pid > -1)
1609 panic("union: unlocking other process's union node");
1610#endif
1611
1612 un->un_flags &= ~UN_LOCKED;
1613
1614 if ((un->un_flags & (UN_ULOCK|UN_KLOCK)) == UN_ULOCK)
1615 VOP_UNLOCK(un->un_uppervp, 0, p);
1616
1614 if ((un->un_flags & (UN_ULOCK|UN_KLOCK)) == UN_ULOCK) {
1615 /*
1616 * XXX
1617 * Workarround for lockmgr violation. Need to implement
1618 * real lockmgr-style lock/unlock.
1619 */
1620 if ((ap->a_vp->v_flag & VDOOMED) &&
1621 ((struct lock *)un->un_uppervp->v_data)->lk_lockholder
1622 == LK_KERNPROC)
1623 VOP_UNLOCK(un->un_uppervp, 0, 0);
1624 else
1625 VOP_UNLOCK(un->un_uppervp, 0, p);
1626 }
1617 un->un_flags &= ~UN_ULOCK;
1618
1619 if (un->un_flags & UN_WANT) {
1620 un->un_flags &= ~UN_WANT;
1621 wakeup((caddr_t) &un->un_flags);
1622 }
1623
1624#ifdef DIAGNOSTIC

--- 185 unchanged lines hidden ---
1627 un->un_flags &= ~UN_ULOCK;
1628
1629 if (un->un_flags & UN_WANT) {
1630 un->un_flags &= ~UN_WANT;
1631 wakeup((caddr_t) &un->un_flags);
1632 }
1633
1634#ifdef DIAGNOSTIC

--- 185 unchanged lines hidden ---