From 95aad63765ded717a3938f541d295a29240119db Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 13 Mar 2005 11:59:14 +0000 Subject: - In ufs_mknod(), hold the lock across the call to vgone() as that is now required. - In ufs_close(), don't do the EAGAIN vrele hack, the top layer now calls vn_start_write before the lock is acquired as it should. Sponsored by: Isilon Systems, Inc. --- sys/ufs/ufs/ufs_vnops.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'sys/ufs') diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 2eadb2d..4b5fc7b 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -219,12 +219,12 @@ ufs_mknod(ap) /* * Remove inode, then reload it through VFS_VGET so it is * checked to see if it is an alias of an existing entry in - * the inode cache. + * the inode cache. XXX I don't believe this is necessary now. */ - vput(*vpp); (*vpp)->v_type = VNON; ino = ip->i_number; /* Save this before vgone() invalidates ip. */ vgone(*vpp); + vput(*vpp); error = VFS_VGET(ap->a_dvp->v_mount, ino, LK_EXCLUSIVE, vpp); if (error) { *vpp = NULL; @@ -273,31 +273,11 @@ ufs_close(ap) } */ *ap; { struct vnode *vp = ap->a_vp; - struct mount *mp; VI_LOCK(vp); - if (vp->v_usecount > 1) { + if (vp->v_usecount > 1) ufs_itimes(vp); - VI_UNLOCK(vp); - } else { - VI_UNLOCK(vp); - /* - * If we are closing the last reference to an unlinked - * file, then it will be freed by the inactive routine. - * Because the freeing causes a the filesystem to be - * modified, it must be held up during periods when the - * filesystem is suspended. - * - * XXX - EAGAIN is returned to prevent vn_close from - * repeating the vrele operation. - */ - if (vp->v_type == VREG && VTOI(vp)->i_effnlink == 0) { - (void) vn_start_write(vp, &mp, V_WAIT); - vrele(vp); - vn_finished_write(mp); - return (EAGAIN); - } - } + VI_UNLOCK(vp); return (0); } -- cgit v1.1