summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-03-13 11:59:14 +0000
committerjeff <jeff@FreeBSD.org>2005-03-13 11:59:14 +0000
commit95aad63765ded717a3938f541d295a29240119db (patch)
treebbc81544a1d0e9fb6e5e9da08803738b5491c2e3 /sys/ufs
parentc376ae435b71dba28c26da9e532da125946047f0 (diff)
downloadFreeBSD-src-95aad63765ded717a3938f541d295a29240119db.zip
FreeBSD-src-95aad63765ded717a3938f541d295a29240119db.tar.gz
- 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.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c28
1 files changed, 4 insertions, 24 deletions
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);
}
OpenPOWER on IntegriCloud