From 02517b6731ab2da44ce9b49260429744cf0114d5 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 4 Aug 2002 10:29:36 +0000 Subject: - Replace v_flag with v_iflag and v_vflag - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS --- sys/kern/vfs_extattr.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sys/kern/vfs_extattr.c') diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index f02f62f..197829b 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -1155,7 +1155,8 @@ restart: * * XXX: can this only be a VDIR case? */ - if (vp->v_flag & VROOT) + mp_fixme("Accessing vflags w/o the vn lock."); + if (vp->v_vflag & VV_ROOT) error = EBUSY; } if (vn_start_write(nd.ni_dvp, &mp, V_NOWAIT) != 0) { @@ -2778,7 +2779,7 @@ restart: /* * The root of a mounted filesystem cannot be deleted. */ - if (vp->v_flag & VROOT) { + if (vp->v_vflag & VV_ROOT) { error = EBUSY; goto out; } @@ -2939,7 +2940,8 @@ unionread: return (error); } } - if ((vp->v_flag & VROOT) && + mp_fixme("Accessing vflags w/o vn lock."); + if ((vp->v_vflag & VV_ROOT) && (vp->v_mount->mnt_flag & MNT_UNION)) { struct vnode *tvp = vp; vp = vp->v_mount->mnt_vnodecovered; @@ -3030,7 +3032,8 @@ unionread: return (error); } } - if ((vp->v_flag & VROOT) && + mp_fixme("Accessing vflag without vn lock."); + if ((vp->v_vflag & VV_ROOT) && (vp->v_mount->mnt_flag & MNT_UNION)) { struct vnode *tvp = vp; vp = vp->v_mount->mnt_vnodecovered; -- cgit v1.1