summary |
tags |
clone url |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5e06341)
SCCS-vsn: sys/miscfs/union/union_vnops.c 8.5
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)union_vnops.c 8.4 (Berkeley) %G%
+ * @(#)union_vnops.c 8.5 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
} */ *ap;
{
struct union_node *un = VTOUNION(ap->a_vp);
} */ *ap;
{
struct union_node *un = VTOUNION(ap->a_vp);
struct vnode *vp;
if (vp = un->un_lowervp) {
struct vnode *vp;
if (vp = un->un_lowervp) {
union_lock(ap)
struct vop_lock_args *ap;
{
union_lock(ap)
struct vop_lock_args *ap;
{
- struct union_node *un = VTOUNION(ap->a_vp);
+ struct vnode *vp = ap->a_vp;
+ struct union_node *un;
+
+start:
+ while (vp->v_flag & VXLOCK) {
+ vp->v_flag |= VXWANT;
+ sleep((caddr_t)vp, PINOD);
+ }
+
+ un = VTOUNION(vp);
if (un->un_uppervp) {
if ((un->un_flags & UN_ULOCK) == 0) {
if (un->un_uppervp) {
if ((un->un_flags & UN_ULOCK) == 0) {
- VOP_LOCK(un->un_uppervp);
un->un_flags |= UN_ULOCK;
un->un_flags |= UN_ULOCK;
+ VOP_LOCK(un->un_uppervp);
}
#ifdef DIAGNOSTIC
if (un->un_flags & UN_KLOCK)
}
#ifdef DIAGNOSTIC
if (un->un_flags & UN_KLOCK)
- while (un->un_flags & UN_LOCKED) {
+ if (un->un_flags & UN_LOCKED) {
#ifdef DIAGNOSTIC
if (curproc && un->un_pid == curproc->p_pid &&
un->un_pid > -1 && curproc->p_pid > -1)
#ifdef DIAGNOSTIC
if (curproc && un->un_pid == curproc->p_pid &&
un->un_pid > -1 && curproc->p_pid > -1)
#endif
un->un_flags |= UN_WANT;
sleep((caddr_t) &un->un_flags, PINOD);
#endif
un->un_flags |= UN_WANT;
sleep((caddr_t) &un->un_flags, PINOD);
- un->un_flags |= UN_LOCKED;
#ifdef DIAGNOSTIC
if (curproc)
#ifdef DIAGNOSTIC
if (curproc)
+ un->un_flags |= UN_LOCKED;