Page MenuHomeFreeBSD

D39207.id119250.diff
No OneTemporary

D39207.id119250.diff

diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c
--- a/sys/fs/fdescfs/fdesc_vfsops.c
+++ b/sys/fs/fdescfs/fdesc_vfsops.c
@@ -90,8 +90,7 @@
if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
return (EOPNOTSUPP);
- fmp = malloc(sizeof(struct fdescmount),
- M_FDESCMNT, M_WAITOK); /* XXX */
+ fmp = malloc(sizeof(struct fdescmount), M_FDESCMNT, M_WAITOK);
/*
* We need to initialize a few bits of our local mount point struct to
diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c
--- a/sys/fs/fdescfs/fdesc_vnops.c
+++ b/sys/fs/fdescfs/fdesc_vnops.c
@@ -147,6 +147,7 @@
struct fdhashhead *fc;
struct fdescnode *fd, *fd2;
struct vnode *vp, *vp2;
+ enum vgetstate vgs;
int error;
fc = FD_NHASH(ix);
@@ -166,9 +167,9 @@
if (fd->fd_ix == ix && fd->fd_vnode->v_mount == mp) {
/* Get reference to vnode in case it's being free'd */
vp = fd->fd_vnode;
- VI_LOCK(vp);
+ vgs = vget_prep(vp);
mtx_unlock(&fdesc_hashmtx);
- if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK))
+ if (vget_finish(vp, LK_EXCLUSIVE, vgs) != 0)
goto loop;
*vpp = vp;
return (0);
@@ -184,6 +185,7 @@
return (error);
}
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+ VN_LOCK_AREC(vp);
vp->v_data = fd;
fd->fd_vnode = vp;
fd->fd_type = ftype;
@@ -218,9 +220,9 @@
if (fd2->fd_ix == ix && fd2->fd_vnode->v_mount == mp) {
/* Get reference to vnode in case it's being free'd */
vp2 = fd2->fd_vnode;
- VI_LOCK(vp2);
+ vgs = vget_prep(vp2);
mtx_unlock(&fdesc_hashmtx);
- error = vget(vp2, LK_EXCLUSIVE | LK_INTERLOCK);
+ error = vget_finish(vp2, LK_EXCLUSIVE, vgs);
/* Someone beat us, dec use count and wait for reclaim */
vgone(vp);
vput(vp);
@@ -362,13 +364,11 @@
* In case we're holding the last reference to the file, the dvp
* will be re-acquired.
*/
- vhold(dvp);
VOP_UNLOCK(dvp);
fdrop(fp, td);
fdropped = true;
vn_lock(dvp, LK_RETRY | LK_EXCLUSIVE);
- vdrop(dvp);
fvp = dvp;
if (error == 0 && VN_IS_DOOMED(dvp))
error = ENOENT;

File Metadata

Mime Type
text/plain
Expires
Fri, Aug 7, 8:16 AM (5 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36155363
Default Alt Text
D39207.id119250.diff (2 KB)

Event Timeline