summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-03-17 01:25:47 +0000
committermckusick <mckusick@FreeBSD.org>2002-03-17 01:25:47 +0000
commit14dd08fd153468502c32dc2d9c1e25a6c2d761d1 (patch)
treeee06559e7b5061e6fc6cf074dfca793dd31c681b /sys/fs
parent34dcf8975d103d034d7e8b6788c0645cc93af254 (diff)
downloadFreeBSD-src-14dd08fd153468502c32dc2d9c1e25a6c2d761d1.zip
FreeBSD-src-14dd08fd153468502c32dc2d9c1e25a6c2d761d1.tar.gz
Add a flags parameter to VFS_VGET to pass through the desired
locking flags when acquiring a vnode. The immediate purpose is to allow polling lock requests (LK_NOWAIT) needed by soft updates to avoid deadlock when enlisting other processes to help with the background cleanup. For the future it will allow the use of shared locks for read access to vnodes. This change touches a lot of files as it affects most filesystems within the system. It has been well tested on FFS, loopback, and CD-ROM filesystems. only lightly on the others, so if you find a problem there, please let me (mckusick@mckusick.com) know.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/cd9660/cd9660_lookup.c6
-rw-r--r--sys/fs/cd9660/cd9660_node.c18
-rw-r--r--sys/fs/cd9660/cd9660_node.h2
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c30
-rw-r--r--sys/fs/cd9660/iso.h2
-rw-r--r--sys/fs/coda/coda_vnops.c2
-rw-r--r--sys/fs/hpfs/hpfs.h2
-rw-r--r--sys/fs/hpfs/hpfs_hash.c18
-rw-r--r--sys/fs/hpfs/hpfs_subr.c5
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c18
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c26
-rw-r--r--sys/fs/ntfs/ntfs_subr.c2
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c16
-rw-r--r--sys/fs/ntfs/ntfs_vnops.c4
-rw-r--r--sys/fs/nullfs/null_vfsops.c8
-rw-r--r--sys/fs/smbfs/smbfs_vfsops.c6
-rw-r--r--sys/fs/umapfs/umap_vfsops.c7
17 files changed, 110 insertions, 62 deletions
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c
index 706a7ae..da927e1 100644
--- a/sys/fs/cd9660/cd9660_lookup.c
+++ b/sys/fs/cd9660/cd9660_lookup.c
@@ -352,7 +352,8 @@ found:
*/
if (flags & ISDOTDOT) {
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
- error = cd9660_vget_internal(vdp->v_mount, dp->i_ino, &tdp,
+ error = cd9660_vget_internal(vdp->v_mount, dp->i_ino,
+ LK_EXCLUSIVE, &tdp,
dp->i_ino != ino, ep);
brelse(bp);
if (error) {
@@ -373,7 +374,8 @@ found:
VREF(vdp); /* we want ourself, ie "." */
*vpp = vdp;
} else {
- error = cd9660_vget_internal(vdp->v_mount, dp->i_ino, &tdp,
+ error = cd9660_vget_internal(vdp->v_mount, dp->i_ino,
+ LK_EXCLUSIVE, &tdp,
dp->i_ino != ino, ep);
brelse(bp);
if (error)
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index 53ffeca..0060364 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -92,15 +92,19 @@ cd9660_uninit(vfsp)
* Use the device/inum pair to find the incore inode, and return a pointer
* to it. If it is in core, but locked, wait for it.
*/
-struct vnode *
-cd9660_ihashget(dev, inum)
+int
+cd9660_ihashget(dev, inum, flags, vpp)
dev_t dev;
ino_t inum;
+ int flags;
+ struct vnode **vpp;
{
struct thread *td = curthread; /* XXX */
struct iso_node *ip;
struct vnode *vp;
+ int error;
+ *vpp = NULL;
loop:
mtx_lock(&cd9660_ihash_mtx);
for (ip = isohashtbl[INOHASH(dev, inum)]; ip; ip = ip->i_next) {
@@ -108,13 +112,17 @@ loop:
vp = ITOV(ip);
mtx_lock(&vp->v_interlock);
mtx_unlock(&cd9660_ihash_mtx);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td))
+ error = vget(vp, flags | LK_INTERLOCK, td);
+ if (error == ENOENT)
goto loop;
- return (vp);
+ if (error)
+ return (error);
+ *vpp = vp;
+ return (0);
}
}
mtx_unlock(&cd9660_ihash_mtx);
- return (NULL);
+ return (0);
}
/*
diff --git a/sys/fs/cd9660/cd9660_node.h b/sys/fs/cd9660/cd9660_node.h
index 100c08e..2a0d7ef 100644
--- a/sys/fs/cd9660/cd9660_node.h
+++ b/sys/fs/cd9660/cd9660_node.h
@@ -117,7 +117,7 @@ void cd9660_defattr __P((struct iso_directory_record *,
struct iso_node *, struct buf *, enum ISO_FTYPE));
void cd9660_deftstamp __P((struct iso_directory_record *,
struct iso_node *, struct buf *, enum ISO_FTYPE));
-struct vnode *cd9660_ihashget __P((dev_t, ino_t));
+int cd9660_ihashget __P((dev_t, ino_t, int, struct vnode **));
void cd9660_ihashins __P((struct iso_node *));
int cd9660_tstamp_conv7 __P((u_char *, struct timespec *, enum ISO_FTYPE));
int cd9660_tstamp_conv17 __P((u_char *, struct timespec *));
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 1e3719d..60a7b38 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -69,7 +69,7 @@ static int cd9660_mount __P((struct mount *,
static int cd9660_unmount __P((struct mount *, int, struct thread *));
static int cd9660_root __P((struct mount *, struct vnode **));
static int cd9660_statfs __P((struct mount *, struct statfs *, struct thread *));
-static int cd9660_vget __P((struct mount *, ino_t, struct vnode **));
+static int cd9660_vget __P((struct mount *, ino_t, int, struct vnode **));
static int cd9660_fhtovp __P((struct mount *, struct fid *, struct vnode **));
static int cd9660_vptofh __P((struct vnode *, struct fid *));
@@ -578,7 +578,7 @@ cd9660_root(mp, vpp)
* With RRIP we must use the `.' entry of the root directory.
* Simply tell vget, that it's a relocated directory.
*/
- return (cd9660_vget_internal(mp, ino, vpp,
+ return (cd9660_vget_internal(mp, ino, LK_EXCLUSIVE, vpp,
imp->iso_ftype == ISO_FTYPE_RRIP, dp));
}
@@ -644,7 +644,7 @@ cd9660_fhtovp(mp, fhp, vpp)
ifhp->ifid_ino, ifhp->ifid_start);
#endif
- if ((error = VFS_VGET(mp, ifhp->ifid_ino, &nvp)) != 0) {
+ if ((error = VFS_VGET(mp, ifhp->ifid_ino, LK_EXCLUSIVE, &nvp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -659,9 +659,10 @@ cd9660_fhtovp(mp, fhp, vpp)
}
int
-cd9660_vget(mp, ino, vpp)
+cd9660_vget(mp, ino, flags, vpp)
struct mount *mp;
ino_t ino;
+ int flags;
struct vnode **vpp;
{
@@ -671,7 +672,7 @@ cd9660_vget(mp, ino, vpp)
* and force the extra read, but I don't want to think about fixing
* that right now.
*/
- return (cd9660_vget_internal(mp, ino, vpp,
+ return (cd9660_vget_internal(mp, ino, flags, vpp,
#if 0
VFSTOISOFS(mp)->iso_ftype == ISO_FTYPE_RRIP,
#else
@@ -681,9 +682,10 @@ cd9660_vget(mp, ino, vpp)
}
int
-cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
+cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir)
struct mount *mp;
ino_t ino;
+ int flags;
struct vnode **vpp;
int relocated;
struct iso_directory_record *isodir;
@@ -697,7 +699,9 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
imp = VFSTOISOFS(mp);
dev = imp->im_dev;
- if ((*vpp = cd9660_ihashget(dev, ino)) != NULLVP)
+ if ((error = cd9660_ihashget(dev, ino, flags, vpp)) != 0)
+ return (error);
+ if (*vpp != NULL)
return (0);
/* Allocate a new vnode/iso_node. */
@@ -718,6 +722,18 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
ip->i_number = ino;
/*
+ * Check to be sure that it did not show up. We have to put it
+ * on the hash chain as the cleanup from vput expects to find
+ * it there.
+ */
+ if ((error = cd9660_ihashget(dev, ino, flags, vpp)) != 0 ||
+ *vpp != NULL) {
+ cd9660_ihashins(ip);
+ vput(vp);
+ return (error);
+ }
+
+ /*
* Put it onto its hash chain and lock it so that other requests for
* this inode will block if they arrive while we are sleeping waiting
* for old data structures to be purged or for the contents of the
diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h
index b62c723..453423a 100644
--- a/sys/fs/cd9660/iso.h
+++ b/sys/fs/cd9660/iso.h
@@ -254,7 +254,7 @@ struct iso_mnt {
#define lblkno(imp, loc) ((loc) >> (imp)->im_bshift)
#define blksize(imp, ip, lbn) ((imp)->logical_block_size)
-int cd9660_vget_internal __P((struct mount *, ino_t, struct vnode **, int,
+int cd9660_vget_internal __P((struct mount *, ino_t, int, struct vnode **, int,
struct iso_directory_record *));
int cd9660_init __P((struct vfsconf *));
int cd9660_uninit __P((struct vfsconf *));
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index 646ee34..c47d309 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -1854,7 +1854,7 @@ coda_grab_vnode(dev_t dev, ino_t ino, struct vnode **vpp)
}
/* XXX - ensure that nonzero-return means failure */
- error = VFS_VGET(mp,ino,vpp);
+ error = VFS_VGET(mp,ino,LK_EXCLUSIVE,vpp);
if (error) {
myprintf(("coda_grab_vnode: iget/vget(%lx, %lu) returns %p, err %d\n",
(u_long)dev2udev(dev), (u_long)ino, (void *)*vpp, error));
diff --git a/sys/fs/hpfs/hpfs.h b/sys/fs/hpfs/hpfs.h
index bd90ce4..ec2cfad 100644
--- a/sys/fs/hpfs/hpfs.h
+++ b/sys/fs/hpfs/hpfs.h
@@ -393,7 +393,7 @@ void hpfs_hphashinit __P((void));
void hpfs_hphashdestroy __P((void));
struct hpfsnode *hpfs_hphashlookup __P((dev_t, lsn_t));
struct hpfsnode *hpfs_hphashget __P((dev_t, lsn_t));
-struct vnode *hpfs_hphashvget __P((dev_t, lsn_t, struct thread *));
+int hpfs_hphashvget __P((dev_t, lsn_t, int, struct vnode **, struct thread *));
void hpfs_hphashins __P((register struct hpfsnode *));
void hpfs_hphashrem __P((register struct hpfsnode *));
extern struct lock hpfs_hphash_lock;
diff --git a/sys/fs/hpfs/hpfs_hash.c b/sys/fs/hpfs/hpfs_hash.c
index 1c6601a..0a04a9a 100644
--- a/sys/fs/hpfs/hpfs_hash.c
+++ b/sys/fs/hpfs/hpfs_hash.c
@@ -122,15 +122,19 @@ loop:
}
#endif
-struct vnode *
-hpfs_hphashvget(dev, ino, td)
+int
+hpfs_hphashvget(dev, ino, flags, vpp, td)
dev_t dev;
lsn_t ino;
+ int flags;
+ struct vnode **vpp;
struct thread *td;
{
struct hpfsnode *hp;
struct vnode *vp;
+ int error;
+ *vpp = NULLVP;
loop:
mtx_lock(&hpfs_hphash_mtx);
LIST_FOREACH(hp, HPNOHASH(dev, ino), h_hash) {
@@ -138,13 +142,17 @@ loop:
vp = HPTOV(hp);
mtx_lock(&vp->v_interlock);
mtx_unlock(&hpfs_hphash_mtx);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td))
+ error = vget(vp, flags | LK_INTERLOCK, td);
+ if (error == ENOENT)
goto loop;
- return (vp);
+ if (error)
+ return (error);
+ *vpp = vp;
+ return (0);
}
}
mtx_unlock(&hpfs_hphash_mtx);
- return (NULLVP);
+ return (0);
}
/*
diff --git a/sys/fs/hpfs/hpfs_subr.c b/sys/fs/hpfs/hpfs_subr.c
index 5fa32a5..b45ebbd 100644
--- a/sys/fs/hpfs/hpfs_subr.c
+++ b/sys/fs/hpfs/hpfs_subr.c
@@ -536,7 +536,8 @@ hpfs_validateparent (
if (hp->h_no == hp->h_fn.fn_parent) {
dhp = hp;
} else {
- error = VFS_VGET(hpmp->hpm_mp, hp->h_fn.fn_parent, &dvp);
+ error = VFS_VGET(hpmp->hpm_mp, hp->h_fn.fn_parent,
+ LK_EXCLUSIVE, &dvp);
if (error)
return (error);
dhp = VTOHP(dvp);
@@ -689,7 +690,7 @@ hpfs_updateparent (
dhp = hp;
} else {
error = VFS_VGET(hp->h_hpmp->hpm_mp, hp->h_fn.fn_parent,
- &dvp);
+ LK_EXCLUSIVE, &dvp);
if (error)
return (error);
dhp = VTOHP(dvp);
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index dcb5995..cf3c114 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -59,7 +59,7 @@ static int hpfs_root __P((struct mount *, struct vnode **));
static int hpfs_statfs __P((struct mount *, struct statfs *,
struct thread *));
static int hpfs_unmount __P((struct mount *, int, struct thread *));
-static int hpfs_vget __P((struct mount *mp, ino_t ino,
+static int hpfs_vget __P((struct mount *mp, ino_t ino, int flags,
struct vnode **vpp));
static int hpfs_mountfs __P((register struct vnode *, struct mount *,
struct hpfs_args *, struct thread *));
@@ -380,7 +380,7 @@ hpfs_root(
struct hpfsmount *hpmp = VFSTOHPFS(mp);
dprintf(("hpfs_root():\n"));
- error = VFS_VGET(mp, (ino_t)hpmp->hpm_su.su_rootfno, vpp);
+ error = VFS_VGET(mp, (ino_t)hpmp->hpm_su.su_rootfno, LK_EXCLUSIVE, vpp);
if(error) {
printf("hpfs_root: VFS_VGET failed: %d\n",error);
return (error);
@@ -429,7 +429,7 @@ hpfs_fhtovp(
struct hpfid *hpfhp = (struct hpfid *)fhp;
int error;
- if ((error = VFS_VGET(mp, hpfhp->hpfid_ino, &nvp)) != 0) {
+ if ((error = VFS_VGET(mp, hpfhp->hpfid_ino, LK_EXCLUSIVE, &nvp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -460,6 +460,7 @@ static int
hpfs_vget(
struct mount *mp,
ino_t ino,
+ int flags,
struct vnode **vpp)
{
struct hpfsmount *hpmp = VFSTOHPFS(mp);
@@ -475,7 +476,9 @@ hpfs_vget(
hp = NULL;
vp = NULL;
- if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, td)) != NULL) {
+ if ((error = hpfs_hphashvget(hpmp->hpm_dev, ino, flags, vpp, td)) != 0)
+ return (error);
+ if (*vpp != NULL) {
dprintf(("hashed\n"));
return (0);
}
@@ -531,7 +534,12 @@ hpfs_vget(
}
do {
- if ((*vpp = hpfs_hphashvget(hpmp->hpm_dev, ino, td)) != NULL) {
+ if ((error =
+ hpfs_hphashvget(hpmp->hpm_dev, ino, flags, vpp, td))) {
+ vput(vp);
+ return (error);
+ }
+ if (*vpp != NULL) {
dprintf(("hashed2\n"));
vput(vp);
return (0);
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index e3ed555..7b4d731 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -1096,21 +1096,18 @@ hpfs_lookup(ap)
dprintf(("hpfs_lookup(0x%x,...): .. faked (0x%x)\n",
dhp->h_no, dhp->h_fn.fn_parent));
- VOP_UNLOCK(dvp,0,cnp->cn_thread);
-
- error = VFS_VGET(hpmp->hpm_mp,
- dhp->h_fn.fn_parent, ap->a_vpp);
- if(error) {
+ if (VFS_VGET(hpmp->hpm_mp, dhp->h_fn.fn_parent,
+ LK_NOWAIT | LK_EXCLUSIVE, ap->a_vpp)) {
+ VOP_UNLOCK(dvp,0,cnp->cn_thread);
+ error = VFS_VGET(hpmp->hpm_mp,
+ dhp->h_fn.fn_parent, LK_EXCLUSIVE, ap->a_vpp);
VOP_LOCK(dvp, 0, cnp->cn_thread);
- return(error);
- }
-
- if( lockparent && (flags & ISLASTCN) &&
- (error = VOP_LOCK(dvp, 0, cnp->cn_thread)) ) {
- vput( *(ap->a_vpp) );
- return (error);
+ if(error)
+ return(error);
}
- return (error);
+ if (!lockparent || !(flags & ISLASTCN))
+ VOP_UNLOCK(dvp,0,cnp->cn_thread);
+ return (0);
} else {
struct buf *bp;
struct hpfsdirent *dep;
@@ -1148,7 +1145,8 @@ hpfs_lookup(ap)
return (0);
}
- error = VFS_VGET(hpmp->hpm_mp, dep->de_fnode, ap->a_vpp);
+ error = VFS_VGET(hpmp->hpm_mp, dep->de_fnode, LK_EXCLUSIVE,
+ ap->a_vpp);
if (error) {
printf("hpfs_lookup: VFS_VGET FAILED %d\n", error);
brelse(bp);
diff --git a/sys/fs/ntfs/ntfs_subr.c b/sys/fs/ntfs/ntfs_subr.c
index f14d741..de239f0 100644
--- a/sys/fs/ntfs/ntfs_subr.c
+++ b/sys/fs/ntfs/ntfs_subr.c
@@ -1946,7 +1946,7 @@ ntfs_toupper_use(mp, ntmp)
MALLOC(ntfs_toupper_tab, wchar *, 65536 * sizeof(wchar),
M_NTFSRDATA, M_WAITOK);
- if ((error = VFS_VGET(mp, NTFS_UPCASEINO, &vp)))
+ if ((error = VFS_VGET(mp, NTFS_UPCASEINO, LK_EXCLUSIVE, &vp)))
goto out;
error = ntfs_readattr(ntmp, VTONT(vp), NTFS_A_DATA, NULL,
0, 65536*sizeof(wchar), (char *) ntfs_toupper_tab, NULL);
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index 712d4d3..48bacbe 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -68,7 +68,7 @@ static int ntfs_root __P((struct mount *, struct vnode **));
static int ntfs_statfs __P((struct mount *, struct statfs *,
struct thread *));
static int ntfs_unmount __P((struct mount *, int, struct thread *));
-static int ntfs_vget __P((struct mount *mp, ino_t ino,
+static int ntfs_vget __P((struct mount *mp, ino_t ino, int lkflags,
struct vnode **vpp));
static int ntfs_mountfs __P((register struct vnode *, struct mount *,
struct ntfs_args *, struct thread *));
@@ -367,7 +367,8 @@ ntfs_mountfs(devvp, mp, argsp, td)
{
int pi[3] = { NTFS_MFTINO, NTFS_ROOTINO, NTFS_BITMAPINO };
for (i=0; i<3; i++) {
- error = VFS_VGET(mp, pi[i], &(ntmp->ntm_sysvn[pi[i]]));
+ error = VFS_VGET(mp, pi[i], LK_EXCLUSIVE,
+ &(ntmp->ntm_sysvn[pi[i]]));
if(error)
goto out1;
ntmp->ntm_sysvn[pi[i]]->v_flag |= VSYSTEM;
@@ -397,7 +398,7 @@ ntfs_mountfs(devvp, mp, argsp, td)
struct attrdef ad;
/* Open $AttrDef */
- error = VFS_VGET(mp, NTFS_ATTRDEFINO, &vp );
+ error = VFS_VGET(mp, NTFS_ATTRDEFINO, LK_EXCLUSIVE, &vp );
if(error)
goto out1;
@@ -537,7 +538,7 @@ ntfs_root(
dprintf(("ntfs_root(): sysvn: %p\n",
VFSTONTFS(mp)->ntm_sysvn[NTFS_ROOTINO]));
- error = VFS_VGET(mp, (ino_t)NTFS_ROOTINO, &nvp);
+ error = VFS_VGET(mp, (ino_t)NTFS_ROOTINO, LK_EXCLUSIVE, &nvp);
if(error) {
printf("ntfs_root: VFS_VGET failed: %d\n",error);
return (error);
@@ -625,7 +626,7 @@ ntfs_fhtovp(
ddprintf(("ntfs_fhtovp(): %d\n", ntfhp->ntfid_ino));
- if ((error = VFS_VGET(mp, ntfhp->ntfid_ino, &nvp)) != 0) {
+ if ((error = VFS_VGET(mp, ntfhp->ntfid_ino, LK_EXCLUSIVE, &nvp)) != 0) {
*vpp = NULLVP;
return (error);
}
@@ -768,10 +769,11 @@ static int
ntfs_vget(
struct mount *mp,
ino_t ino,
+ int lkflags,
struct vnode **vpp)
{
- return ntfs_vgetex(mp, ino, NTFS_A_DATA, NULL,
- LK_EXCLUSIVE | LK_RETRY, 0, curthread, vpp);
+ return ntfs_vgetex(mp, ino, NTFS_A_DATA, NULL, lkflags, 0,
+ curthread, vpp);
}
static struct vfsops ntfs_vfsops = {
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index e07914b..31b910b 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -629,8 +629,8 @@ ntfs_lookup(ap)
dprintf(("ntfs_lookup: parentdir: %d\n",
vap->va_a_name->n_pnumber));
- error = VFS_VGET(ntmp->ntm_mountp,
- vap->va_a_name->n_pnumber,ap->a_vpp);
+ error = VFS_VGET(ntmp->ntm_mountp, vap->va_a_name->n_pnumber,
+ LK_EXCLUSIVE, ap->a_vpp);
ntfs_ntvattrrele(vap);
if (error) {
if (vn_lock(dvp,LK_EXCLUSIVE|LK_RETRY,cnp->cn_thread)==0)
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index 1ab0aaa..d0a1ed1 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -73,7 +73,8 @@ static int nullfs_statfs(struct mount *mp, struct statfs *sbp,
static int nullfs_sync(struct mount *mp, int waitfor,
struct ucred *cred, struct thread *td);
static int nullfs_unmount(struct mount *mp, int mntflags, struct thread *td);
-static int nullfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp);
+static int nullfs_vget(struct mount *mp, ino_t ino, int flags,
+ struct vnode **vpp);
static int nullfs_vptofh(struct vnode *vp, struct fid *fhp);
static int nullfs_extattrctl(struct mount *mp, int cmd,
struct vnode *filename_vp,
@@ -344,13 +345,14 @@ nullfs_sync(mp, waitfor, cred, td)
}
static int
-nullfs_vget(mp, ino, vpp)
+nullfs_vget(mp, ino, flags, vpp)
struct mount *mp;
ino_t ino;
+ int flags;
struct vnode **vpp;
{
int error;
- error = VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, vpp);
+ error = VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, flags, vpp);
if (error)
return (error);
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
index b3b5cd3..575585c 100644
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -90,7 +90,8 @@ static int smbfs_init(struct vfsconf *vfsp);
static int smbfs_uninit(struct vfsconf *vfsp);
#if __FreeBSD_version < 400009
-static int smbfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp);
+static int smbfs_vget(struct mount *mp, ino_t ino, int flags,
+ struct vnode **vpp);
static int smbfs_fhtovp(struct mount *, struct fid *,
struct sockaddr *, struct vnode **, int *,
struct ucred **);
@@ -467,9 +468,10 @@ loop:
* smbfs flat namespace lookup. Unsupported.
*/
/* ARGSUSED */
-static int smbfs_vget(mp, ino, vpp)
+static int smbfs_vget(mp, ino, flags, vpp)
struct mount *mp;
ino_t ino;
+ int flags;
struct vnode **vpp;
{
return (EOPNOTSUPP);
diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c
index a22b8df..17bfdc1 100644
--- a/sys/fs/umapfs/umap_vfsops.c
+++ b/sys/fs/umapfs/umap_vfsops.c
@@ -73,7 +73,7 @@ static int umapfs_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct thread *td));
static int umapfs_unmount __P((struct mount *mp, int mntflags,
struct thread *td));
-static int umapfs_vget __P((struct mount *mp, ino_t ino,
+static int umapfs_vget __P((struct mount *mp, ino_t ino, int flags,
struct vnode **vpp));
static int umapfs_vptofh __P((struct vnode *vp, struct fid *fhp));
static int umapfs_extattrctl __P((struct mount *mp, int cmd,
@@ -387,13 +387,14 @@ umapfs_sync(mp, waitfor, cred, td)
}
static int
-umapfs_vget(mp, ino, vpp)
+umapfs_vget(mp, ino, flags, vpp)
struct mount *mp;
ino_t ino;
+ int flags;
struct vnode **vpp;
{
- return (VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, vpp));
+ return (VFS_VGET(MOUNTTOUMAPMOUNT(mp)->umapm_vfs, ino, flags, vpp));
}
static int
OpenPOWER on IntegriCloud