diff options
Diffstat (limited to 'sys/fs')
33 files changed, 104 insertions, 63 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 53715e7d6da3..980612e66ece 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -869,7 +869,7 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir) } if (ip->iso_extent == imp->root_extent) - vp->v_flag |= VROOT; + vp->v_vflag |= VV_ROOT; /* * XXX need generation number? diff --git a/sys/fs/coda/coda_namecache.c b/sys/fs/coda/coda_namecache.c index 97e5b2eccfe4..f2d494004058 100644 --- a/sys/fs/coda/coda_namecache.c +++ b/sys/fs/coda/coda_namecache.c @@ -613,7 +613,8 @@ coda_nc_flush(dcstat) } vrele(CTOV(cncp->dcp)); - if (CTOV(cncp->cp)->v_flag & VTEXT) { + ASSERT_VOP_LOCKED(CTOV(cnp->cp), "coda_nc_flush"); + if (CTOV(cncp->cp)->v_vflag & VV_TEXT) { if (coda_vmflush(cncp->cp)) CODADEBUG(CODA_FLUSH, myprintf(("coda_nc_flush: (%lx.%lx.%lx) busy\n", cncp->cp->c_fid.Volume, cncp->cp->c_fid.Vnode, cncp->cp->c_fid.Unique)); ) diff --git a/sys/fs/coda/coda_subr.c b/sys/fs/coda/coda_subr.c index 571f9caec0cb..8afe57dc0c24 100644 --- a/sys/fs/coda/coda_subr.c +++ b/sys/fs/coda/coda_subr.c @@ -413,7 +413,8 @@ int handleDownCall(opcode, out) vref(CTOV(cp)); cp->c_flags &= ~C_VATTR; - if (CTOV(cp)->v_flag & VTEXT) + ASSERT_VOP_LOCKED(CTOV(cp), "coda HandleDownCall"); + if (CTOV(cp)->v_vflag & VV_TEXT) error = coda_vmflush(cp); CODADEBUG(CODA_ZAPFILE, myprintf(( "zapfile: fid = (%lx.%lx.%lx), refcnt = %d, error = %d\n", @@ -470,8 +471,9 @@ int handleDownCall(opcode, out) } cp->c_flags &= ~C_VATTR; coda_nc_zapfid(&out->coda_purgefid.CodaFid, IS_DOWNCALL); + ASSERT_VOP_LOCKED(CTOV(cp), "coda HandleDownCall"); if (!(ODD(out->coda_purgefid.CodaFid.Vnode)) - && (CTOV(cp)->v_flag & VTEXT)) { + && (CTOV(cp)->v_vflag & VV_TEXT)) { error = coda_vmflush(cp); } diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 33597d6fc792..5040e68af395 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -192,7 +192,7 @@ coda_mount(vfsp, path, data, ndp, td) rootfid.Unique = 0; cp = make_coda_node(&rootfid, vfsp, VDIR); rootvp = CTOV(cp); - rootvp->v_flag |= VROOT; + rootvp->v_vflag |= VV_ROOT; ctlfid.Volume = CTL_VOL; ctlfid.Vnode = CTL_VNO; @@ -257,7 +257,8 @@ coda_unmount(vfsp, mntflags, td) vrele(mi->mi_rootvp); active = coda_kill(vfsp, NOT_DOWNCALL); - mi->mi_rootvp->v_flag &= ~VROOT; + ASSERT_VOP_LOCKED(mi->mi_rootvp, "coda_unmount"); + mi->mi_rootvp->v_vflag &= ~VV_ROOT; error = vflush(mi->mi_vfsp, 0, FORCECLOSE); printf("coda_unmount: active = %d, vflush active %d\n", active, error); error = 0; diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c index 6ff5038a03a8..6734ebe7c78d 100644 --- a/sys/fs/deadfs/dead_vnops.c +++ b/sys/fs/deadfs/dead_vnops.c @@ -145,7 +145,7 @@ dead_read(ap) /* * Return EOF for tty devices, EIO for others */ - if ((ap->a_vp->v_flag & VISTTY) == 0) + if ((ap->a_vp->v_vflag & VV_ISTTY) == 0) return (EIO); return (0); } @@ -262,11 +262,13 @@ chkvnlock(vp) { int locked = 0; - while (vp->v_flag & VXLOCK) { - vp->v_flag |= VXWANT; - (void) tsleep((caddr_t)vp, PINOD, "ckvnlk", 0); + VI_LOCK(vp); + while (vp->v_iflag & VI_XLOCK) { + vp->v_iflag |= VI_XWANT; + (void) msleep((caddr_t)vp, VI_MTX(vp), PINOD, "ckvnlk", 0); locked = 1; } + VI_UNLOCK(vp); return (locked); } diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c index 00ad137384c8..319a0b73e3e3 100644 --- a/sys/fs/devfs/devfs_vfsops.c +++ b/sys/fs/devfs/devfs_vfsops.c @@ -157,7 +157,7 @@ devfs_root(mp, vpp) error = devfs_allocv(dmp->dm_rootdir, mp, &vp, td); if (error) return (error); - vp->v_flag |= VROOT; + vp->v_vflag |= VV_ROOT; *vpp = vp; return (0); } diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 9ac37452657a..62a7b95ab914 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -313,7 +313,7 @@ devfs_lookupx(ap) if (dvp->v_type != VDIR) return (ENOTDIR); - if ((flags & ISDOTDOT) && (dvp->v_flag & VROOT)) + if ((flags & ISDOTDOT) && (dvp->v_vflag & VV_ROOT)) return (EIO); error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td); diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index d5dc57252f9a..a4741bc3760c 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -91,7 +91,7 @@ fdesc_mount(mp, ndp, td) MALLOC(fmp, struct fdescmount *, sizeof(struct fdescmount), M_FDESCMNT, M_WAITOK); /* XXX */ rvp->v_type = VDIR; - rvp->v_flag |= VROOT; + rvp->v_vflag |= VV_ROOT; fmp->f_root = rvp; /* XXX -- don't mark as local to work around fts() problems */ /*mp->mnt_flag |= MNT_LOCAL;*/ diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index f5340d4ddb3b..f4c808d23571 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -508,7 +508,7 @@ hpfs_vget( vp->v_data = hp; if (ino == (ino_t)hpmp->hpm_su.su_rootfno) - vp->v_flag |= VROOT; + vp->v_vflag |= VV_ROOT; mtx_init(&hp->h_interlock, "hpfsnode interlock", NULL, MTX_DEF); diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c index 827b297d02a7..c9d63791f0d5 100644 --- a/sys/fs/hpfs/hpfs_vnops.c +++ b/sys/fs/hpfs/hpfs_vnops.c @@ -107,10 +107,13 @@ loop: (void) bwrite(bp); goto loop; } + VI_LOCK(vp); while (vp->v_numoutput) { - vp->v_flag |= VBWAIT; - (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "hpfsn", 0); + vp->v_iflag |= VI_BWAIT; + msleep((caddr_t)&vp->v_numoutput, VI_MTX(vp), PRIBIO + 1, + "hpfsn", 0); } + VI_UNLOCK(vp); #ifdef DIAGNOSTIC if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("hpfs_fsync: dirty", vp); diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index 7a0cf798d31f..02b188f4c396 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -300,7 +300,7 @@ deget(pmp, dirclust, diroffset, depp) * exists), and then use the time and date from that entry * as the time and date for the root denode. */ - nvp->v_flag |= VROOT; /* should be further down XXX */ + nvp->v_vflag |= VV_ROOT; /* should be further down XXX */ ldep->de_Attributes = ATTR_DIRECTORY; ldep->de_LowerCase = 0; @@ -442,7 +442,7 @@ detrunc(dep, length, flags, cred, td) * recognize the root directory at this point in a file or * directory's life. */ - if ((DETOV(dep)->v_flag & VROOT) && !FAT32(pmp)) { + if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp)) { printf("detrunc(): can't truncate root directory, clust %ld, offset %ld\n", dep->de_dirclust, dep->de_diroffset); return (EINVAL); @@ -575,7 +575,7 @@ deextend(dep, length, cred) /* * The root of a DOS filesystem cannot be extended. */ - if ((DETOV(dep)->v_flag & VROOT) && !FAT32(pmp)) + if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp)) return (EINVAL); /* diff --git a/sys/fs/msdosfs/msdosfs_lookup.c b/sys/fs/msdosfs/msdosfs_lookup.c index 79b0589e506e..00598c838782 100644 --- a/sys/fs/msdosfs/msdosfs_lookup.c +++ b/sys/fs/msdosfs/msdosfs_lookup.c @@ -136,7 +136,7 @@ msdosfs_lookup(ap) * they won't find it. DOS filesystems don't have them in the root * directory. So, we fake it. deget() is in on this scam too. */ - if ((vdp->v_flag & VROOT) && cnp->cn_nameptr[0] == '.' && + if ((vdp->v_vflag & VV_ROOT) && cnp->cn_nameptr[0] == '.' && (cnp->cn_namelen == 1 || (cnp->cn_namelen == 2 && cnp->cn_nameptr[1] == '.'))) { isadir = ATTR_DIRECTORY; diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index f62b0c79ad7a..0ad34a0ac73c 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -632,8 +632,9 @@ msdosfs_unmount(mp, mntflags, td) struct vnode *vp = pmp->pm_devvp; printf("msdosfs_umount(): just before calling VOP_CLOSE()\n"); - printf("flag %08lx, usecount %d, writecount %d, holdcnt %ld\n", - vp->v_flag, vp->v_usecount, vp->v_writecount, vp->v_holdcnt); + printf("iflag %08lx, usecount %d, writecount %d, holdcnt %ld\n", + vp->vi_flag, vp->v_usecount, vp->v_writecount, + vp->v_holdcnt); printf("id %lu, mount %p, op %p\n", vp->v_id, vp->v_mount, vp->v_op); printf("freef %p, freeb %p, mount %p\n", diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 0a5cc480de44..210e9a82ce22 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -815,6 +815,7 @@ msdosfs_fsync(ap) */ loop: s = splbio(); + VI_LOCK(vp); for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) { nbp = TAILQ_NEXT(bp, b_vnbufs); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT)) @@ -823,13 +824,17 @@ loop: panic("msdosfs_fsync: not dirty"); bremfree(bp); splx(s); + VI_UNLOCK(vp); + /* XXX Could do bawrite */ (void) bwrite(bp); goto loop; } while (vp->v_numoutput) { - vp->v_flag |= VBWAIT; - (void) tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "msdosfsn", 0); + vp->v_vflag |= VI_BWAIT; + (void) msleep((caddr_t)&vp->v_numoutput, VI_MTX(vp), + PRIBIO + 1, "msdosfsn", 0); } + VI_UNLOCK(vp); #ifdef DIAGNOSTIC if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { vprint("msdosfs_fsync: dirty", vp); diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index 82e11584040b..99b18b4a8fa6 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -369,7 +369,7 @@ ntfs_mountfs(devvp, mp, argsp, td) &(ntmp->ntm_sysvn[pi[i]])); if(error) goto out1; - ntmp->ntm_sysvn[pi[i]]->v_flag |= VSYSTEM; + ntmp->ntm_sysvn[pi[i]]->v_vflag |= VV_SYSTEM; VREF(ntmp->ntm_sysvn[pi[i]]); vput(ntmp->ntm_sysvn[pi[i]]); } @@ -746,7 +746,7 @@ ntfs_vgetex( vp->v_type = f_type; if (ino == NTFS_ROOTINO) - vp->v_flag |= VROOT; + vp->v_vflag |= VV_ROOT; ntfs_ntput(ip); diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index a218bf08ba6a..ec41e3008a8e 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -187,8 +187,9 @@ nullfs_mount(mp, ndp, td) * Keep a held reference to the root vnode. * It is vrele'd in nullfs_unmount. */ + mp_fixme("Unlocked vflag access"); nullm_rootvp = vp; - nullm_rootvp->v_flag |= VROOT; + nullm_rootvp->v_vflag |= VV_ROOT; xmp->nullm_rootvp = nullm_rootvp; if (NULLVPTOLOWERVP(nullm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) mp->mnt_flag |= MNT_LOCAL; diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 2b141be83732..54bd884c7472 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -794,7 +794,7 @@ null_createvobject(ap) error = VOP_CREATEVOBJECT(lowervp, ap->a_cred, ap->a_td); if (error) return (error); - vp->v_flag |= VOBJBUF; + vp->v_vflag |= VV_OBJBUF; return (0); } @@ -809,7 +809,7 @@ null_destroyvobject(ap) { struct vnode *vp = ap->a_vp; - vp->v_flag &= ~VOBJBUF; + vp->v_vflag &= ~VV_OBJBUF; return (0); } diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c index 9c7d5fa1e85d..ffcef2afba3f 100644 --- a/sys/fs/nwfs/nwfs_io.c +++ b/sys/fs/nwfs/nwfs_io.c @@ -599,9 +599,13 @@ nwfs_vinvalbuf(vp, flags, cred, td, intrflg) /* struct nwmount *nmp = VTONWFS(vp);*/ int error = 0, slpflag, slptimeo; - if (vp->v_flag & VXLOCK) { + VI_LOCK(vp); + if (vp->v_iflag & VI_XLOCK) { + VI_UNLOCK(vp); return (0); } + VI_UNLOCK(vp); + if (intrflg) { slpflag = PCATCH; slptimeo = 2 * hz; diff --git a/sys/fs/nwfs/nwfs_node.c b/sys/fs/nwfs/nwfs_node.c index d8693fa832d1..daf51e107fd5 100644 --- a/sys/fs/nwfs/nwfs_node.c +++ b/sys/fs/nwfs/nwfs_node.c @@ -203,8 +203,9 @@ rescan: LIST_INSERT_HEAD(nhpp, np, n_hash); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); lockmgr(&nwhashlock, LK_RELEASE, NULL, td); - - if (vp->v_type == VDIR && dvp && (dvp->v_flag & VROOT) == 0) { + + ASSERT_VOP_LOCKED(dvp, "nwfs_allocvp"); + if (vp->v_type == VDIR && dvp && (dvp->v_vflag & VV_ROOT) == 0) { np->n_flag |= NREFPARENT; vref(dvp); } diff --git a/sys/fs/nwfs/nwfs_vfsops.c b/sys/fs/nwfs/nwfs_vfsops.c index dc7d6340f394..76776d95f05f 100644 --- a/sys/fs/nwfs/nwfs_vfsops.c +++ b/sys/fs/nwfs/nwfs_vfsops.c @@ -340,7 +340,7 @@ nwfs_root(struct mount *mp, struct vnode **vpp) { error = nwfs_nget(mp, nmp->n_rootent, &fattr, NULL, &vp); if (error) return (error); - vp->v_flag |= VROOT; + vp->v_vflag |= VV_ROOT; np = VTONW(vp); if (nmp->m.root_path[0] == 0) np->n_flag |= NVOLUME; diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c index 9d773f845e02..b62f4f887ff9 100644 --- a/sys/fs/nwfs/nwfs_vnops.c +++ b/sys/fs/nwfs/nwfs_vnops.c @@ -289,7 +289,7 @@ nwfs_getattr(ap) int error; u_int32_t oldsize; - NCPVNDEBUG("%lx:%d: '%s' %d\n", (long)vp, nmp->n_volume, np->n_name, (vp->v_flag & VROOT) != 0); + NCPVNDEBUG("%lx:%d: '%s' %d\n", (long)vp, nmp->n_volume, np->n_name, (vp->v_vflag & VV_ROOT) != 0); error = nwfs_attr_cachelookup(vp, va); if (!error) return 0; NCPVNDEBUG("not in cache\n"); @@ -859,7 +859,7 @@ nwfs_lookup(ap) if (dvp->v_type != VDIR) return (ENOTDIR); - if ((flags & ISDOTDOT) && (dvp->v_flag & VROOT)) { + if ((flags & ISDOTDOT) && (dvp->v_vflag & VV_ROOT)) { printf("nwfs_lookup: invalid '..'\n"); return EIO; } @@ -877,7 +877,7 @@ nwfs_lookup(ap) nmp = VFSTONWFS(mp); dnp = VTONW(dvp); /* -printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_flag & VROOT, (int)flags & ISDOTDOT); +printf("dvp %d:%d:%d\n", (int)mp, (int)dvp->v_vflag & VV_ROOT, (int)flags & ISDOTDOT); */ error = ncp_pathcheck(cnp->cn_nameptr, cnp->cn_namelen, &nmp->m.nls, (nameiop == CREATE || nameiop == RENAME) && (nmp->m.nls.opt & NWHP_NOSTRICT) == 0); diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index c0f4022dcf58..025721b84aaa 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/portal_vfsops.c @@ -128,7 +128,7 @@ portal_mount(mp, path, data, ndp, td) rvp->v_data = pn; rvp->v_type = VDIR; - rvp->v_flag |= VROOT; + rvp->v_vflag |= VV_ROOT; VTOPORTAL(rvp)->pt_arg = 0; VTOPORTAL(rvp)->pt_size = 0; VTOPORTAL(rvp)->pt_fileid = PORTAL_ROOTFILEID; diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c index b345c573d4be..2d56232378d3 100644 --- a/sys/fs/portalfs/portal_vnops.c +++ b/sys/fs/portalfs/portal_vnops.c @@ -229,7 +229,7 @@ portal_open(ap) /* * Nothing to do when opening the root node. */ - if (vp->v_flag & VROOT) + if (vp->v_vflag & VV_ROOT) return (0); /* @@ -462,7 +462,7 @@ portal_getattr(ap) /* vap->va_qbytes = 0; */ vap->va_bytes = 0; /* vap->va_qsize = 0; */ - if (vp->v_flag & VROOT) { + if (vp->v_vflag & VV_ROOT) { vap->va_type = VDIR; vap->va_mode = S_IRUSR|S_IWUSR|S_IXUSR| S_IRGRP|S_IWGRP|S_IXGRP| @@ -493,7 +493,7 @@ portal_setattr(ap) /* * Can't mess with the root vnode */ - if (ap->a_vp->v_flag & VROOT) + if (ap->a_vp->v_vflag & VV_ROOT) return (EACCES); if (ap->a_vap->va_flags != VNOVAL) diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c index 498de3839f70..8d142e9b78ef 100644 --- a/sys/fs/pseudofs/pseudofs_vncache.c +++ b/sys/fs/pseudofs/pseudofs_vncache.c @@ -143,7 +143,7 @@ pfs_vncache_alloc(struct mount *mp, struct vnode **vpp, (*vpp)->v_data = pvd; switch (pn->pn_type) { case pfstype_root: - (*vpp)->v_flag = VROOT; + (*vpp)->v_vflag = VV_ROOT; #if 0 printf("root vnode allocated\n"); #endif diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index ebb0934f89cc..1baa3847111b 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -671,8 +671,13 @@ smbfs_vinvalbuf(vp, flags, cred, td, intrflg) struct smbnode *np = VTOSMB(vp); int error = 0, slpflag, slptimeo; - if (vp->v_flag & VXLOCK) + VI_LOCK(vp); + if (vp->v_iflag & VI_XLOCK) { + VI_UNLOCK(vp); return 0; + } + VI_UNLOCK(vp); + if (intrflg) { slpflag = PCATCH; slptimeo = 2 * hz; diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c index 8dabd00f3917..4e79f78e3485 100644 --- a/sys/fs/smbfs/smbfs_node.c +++ b/sys/fs/smbfs/smbfs_node.c @@ -235,8 +235,9 @@ loop: np->n_ino = fap->fa_ino; if (dvp) { + ASSERT_VOP_LOCKED(dvp, "smbfs_node_alloc"); np->n_parent = dnp; - if (/*vp->v_type == VDIR &&*/ (dvp->v_flag & VROOT) == 0) { + if (/*vp->v_type == VDIR &&*/ (dvp->v_vflag & VV_ROOT) == 0) { vref(dvp); np->n_flag |= NREFPARENT; } diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index 5edff3f5045a..2c847c3dd31d 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -293,7 +293,8 @@ smbfs_root(struct mount *mp, struct vnode **vpp) error = smbfs_nget(mp, NULL, "TheRooT", 7, &fattr, &vp); if (error) return error; - vp->v_flag |= VROOT; + ASSERT_VOP_LOCKED(vp, "smbfs_root"); + vp->v_vflag |= VV_ROOT; np = VTOSMB(vp); smp->sm_root = np; *vpp = vp; diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index b47148641c1c..219afbf055ff 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -293,7 +293,7 @@ smbfs_close(ap) int error, dolock; VI_LOCK(vp); - dolock = (vp->v_flag & VXLOCK) == 0; + dolock = (vp->v_iflag & VI_XLOCK) == 0; if (dolock) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY | LK_INTERLOCK, td); else @@ -324,7 +324,7 @@ smbfs_getattr(ap) u_int32_t oldsize; int error; - SMBVDEBUG("%lx: '%s' %d\n", (long)vp, np->n_name, (vp->v_flag & VROOT) != 0); + SMBVDEBUG("%lx: '%s' %d\n", (long)vp, np->n_name, (vp->v_vflag & VV_ROOT) != 0); error = smbfs_attr_cachelookup(vp, va); if (!error) return 0; @@ -1135,7 +1135,7 @@ smbfs_lookup(ap) cnp->cn_flags &= ~PDIRUNLOCK; if (dvp->v_type != VDIR) return ENOTDIR; - if ((flags & ISDOTDOT) && (dvp->v_flag & VROOT)) { + if ((flags & ISDOTDOT) && (dvp->v_vflag & VV_ROOT)) { SMBFSERR("invalid '..'\n"); return EIO; } diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index cbb5e3c76936..4fb3d5c47d0a 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -195,7 +195,7 @@ spec_open(ap) /* XXX: Special casing of ttys for deadfs. Probably redundant. */ if (dsw->d_flags & D_TTY) - vp->v_flag |= VISTTY; + vp->v_vflag |= VV_ISTTY; VOP_UNLOCK(vp, 0, td); error = (*dsw->d_open)(dev, ap->a_mode, S_IFCHR, td); @@ -401,7 +401,7 @@ loop2: continue; if ((bp->b_flags & B_DELWRI) == 0) panic("spec_fsync: not dirty"); - if ((vp->v_flag & VOBJBUF) && (bp->b_flags & B_CLUSTEROK)) { + if ((vp->v_vflag & VV_OBJBUF) && (bp->b_flags & B_CLUSTEROK)) { BUF_UNLOCK(bp); vfs_bio_awrite(bp); splx(s); @@ -420,11 +420,13 @@ loop2: * retry if dirty blocks still exist. */ if (ap->a_waitfor == MNT_WAIT) { + VI_LOCK(vp); while (vp->v_numoutput) { - vp->v_flag |= VBWAIT; - (void)tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, - "spfsyn", 0); + vp->v_iflag |= VI_BWAIT; + msleep((caddr_t)&vp->v_numoutput, VI_MTX(vp), + PRIBIO + 1, "spfsyn", 0); } + VI_UNLOCK(vp); if (!TAILQ_EMPTY(&vp->v_dirtyblkhd)) { if (--maxretry != 0) { splx(s); @@ -462,7 +464,9 @@ spec_strategy(ap) bp->b_flags &= ~B_VALIDSUSPWRT; if (LIST_FIRST(&bp->b_dep) != NULL) buf_start(bp); - if ((vp->v_flag & VCOPYONWRITE) && vp->v_rdev->si_copyonwrite && + mp_fixme("This should require the vnode lock."); + if ((vp->v_vflag & VV_COPYONWRITE) && + vp->v_rdev->si_copyonwrite && (error = (*vp->v_rdev->si_copyonwrite)(vp, bp)) != 0 && error != EOPNOTSUPP) { bp->b_io.bio_error = error; @@ -580,6 +584,7 @@ spec_close(ap) struct thread *td = ap->a_td; dev_t dev = vp->v_rdev; + mp_fixme("Use of v_iflags bogusly locked."); /* * Hack: a tty device that is a controlling terminal * has a reference from the session structure. @@ -589,9 +594,15 @@ spec_close(ap) * if the reference count is 2 (this last descriptor * plus the session), release the reference from the session. */ + + /* + * This needs to be rewritten to take the vp interlock into + * consideration. + */ + oldvp = NULL; sx_xlock(&proctree_lock); - if (vcount(vp) == 2 && td && (vp->v_flag & VXLOCK) == 0 && + if (vcount(vp) == 2 && td && (vp->v_iflag & VI_XLOCK) == 0 && vp == td->td_proc->p_session->s_ttyvp) { SESS_LOCK(td->td_proc->p_session); td->td_proc->p_session->s_ttyvp = NULL; @@ -610,7 +621,7 @@ spec_close(ap) * sum of the reference counts on all the aliased * vnodes descends to one, we are on last close. */ - if (vp->v_flag & VXLOCK) { + if (vp->v_iflag & VI_XLOCK) { /* Forced close. */ } else if (devsw(dev)->d_flags & D_TRACKCLOSE) { /* Keep device updated on status. */ diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 17cfd0bfd7dc..adc8c0b099e1 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -497,7 +497,7 @@ udf_root(struct mount *mp, struct vnode **vpp) return error; vp = *vpp; - vp->v_flag |= VROOT; + vp->v_vflag |= VV_ROOT; udfmp->root_vp = vp; return (0); diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index 9e5f0fcb11d0..adb419af42c8 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -223,8 +223,9 @@ umapfs_mount(mp, path, data, ndp, td) * Keep a held reference to the root vnode. * It is vrele'd in umapfs_unmount. */ + ASSERT_VOP_LOCKED(vp, "umapfs_mount"); umapm_rootvp = vp; - umapm_rootvp->v_flag |= VROOT; + umapm_rootvp->v_vflag |= VV_ROOT; amp->umapm_rootvp = umapm_rootvp; if (UMAPVPTOLOWERVP(umapm_rootvp)->v_mount->mnt_flag & MNT_LOCAL) mp->mnt_flag |= MNT_LOCAL; diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index d7bbfb445279..66a4013589de 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -373,7 +373,7 @@ union_allocvp(vpp, mp, dvp, upperdvp, cnp, uppervp, lowervp, docache) if (lowervp != NULLVP) VREF(lowervp); } - vflag = VROOT; + vflag = VV_ROOT; } loop: @@ -563,7 +563,8 @@ loop: MALLOC((*vpp)->v_data, void *, sizeof(struct union_node), M_TEMP, M_WAITOK); - (*vpp)->v_flag |= vflag; + ASSERT_VOP_LOCKED(*vpp, "union_allocvp"); + (*vpp)->v_vflag |= vflag; if (uppervp) (*vpp)->v_type = uppervp->v_type; else diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 80357992c9d9..227e817f499f 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -190,7 +190,7 @@ union_lookup1(udvp, pdvp, vpp, cnp) * hierarchy. */ if (cnp->cn_flags & ISDOTDOT) { - while ((dvp != udvp) && (dvp->v_flag & VROOT)) { + while ((dvp != udvp) && (dvp->v_vflag & VV_ROOT)) { /* * Don't do the NOCROSSMOUNT check * at this level. By definition, @@ -1625,7 +1625,7 @@ union_getwritemount(ap) if (uvp == NULL) { VI_LOCK(vp); - if (vp->v_flag & VFREE) { + if (vp->v_iflag & VI_FREE) { VI_UNLOCK(vp); return (EOPNOTSUPP); } @@ -1788,7 +1788,7 @@ union_createvobject(ap) { struct vnode *vp = ap->a_vp; - vp->v_flag |= VOBJBUF; + vp->v_vflag |= VV_OBJBUF; return (0); } @@ -1803,7 +1803,7 @@ union_destroyvobject(ap) { struct vnode *vp = ap->a_vp; - vp->v_flag &= ~VOBJBUF; + vp->v_vflag &= ~VV_OBJBUF; return (0); } |