summaryrefslogtreecommitdiffstats
path: root/sys/gnu
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-03-13 12:13:55 +0000
committerjeff <jeff@FreeBSD.org>2005-03-13 12:13:55 +0000
commit79cf2c5860e7855a3a8a05b07c3ac0eaaa5fdc9d (patch)
tree517d998d22004dacbcc127c0dd33617a3c91227b /sys/gnu
parent5f59e0cd197952e4dfacaded55511c1117abbecd (diff)
downloadFreeBSD-src-79cf2c5860e7855a3a8a05b07c3ac0eaaa5fdc9d.zip
FreeBSD-src-79cf2c5860e7855a3a8a05b07c3ac0eaaa5fdc9d.tar.gz
- Catch up with ufs_inode 1.59, ffs_vfsops.c 1.280, and ufs_vnops.c 1.267.
Various changes to support new vgone() locking protocol. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/gnu')
-rw-r--r--sys/gnu/ext2fs/ext2_inode.c1
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c15
-rw-r--r--sys/gnu/ext2fs/ext2_vnops.c28
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode.c1
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c15
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vnops.c28
6 files changed, 16 insertions, 72 deletions
diff --git a/sys/gnu/ext2fs/ext2_inode.c b/sys/gnu/ext2fs/ext2_inode.c
index ea3e642..2f48f9c 100644
--- a/sys/gnu/ext2fs/ext2_inode.c
+++ b/sys/gnu/ext2fs/ext2_inode.c
@@ -499,7 +499,6 @@ ext2_inactive(ap)
}
}
out:
- VOP_UNLOCK(vp, 0, td);
/*
* If we are done with the inode, reclaim it
* so that it can be reused immediately.
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index b258065..1e73e12 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -536,20 +536,13 @@ loop:
MNT_ILOCK(mp);
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
- if (vp->v_iflag & VI_XLOCK) {
+ if (vp->v_iflag & VI_DOOMED) {
VI_UNLOCK(vp);
continue;
}
MNT_IUNLOCK(mp);
/*
- * Step 4: invalidate all inactive vnodes.
- */
- if (vp->v_usecount == 0) {
- vgonel(vp, td);
- goto loop;
- }
- /*
- * Step 5: invalidate all cached file data.
+ * Step 4: invalidate all cached file data.
*/
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
goto loop;
@@ -557,7 +550,7 @@ loop:
if (vinvalbuf(vp, 0, td, 0, 0))
panic("ext2_reload: dirty2");
/*
- * Step 6: re-read inode data for all active vnodes.
+ * Step 5: re-read inode data for all active vnodes.
*/
ip = VTOI(vp);
error =
@@ -857,7 +850,7 @@ ext2_sync(mp, waitfor, td)
loop:
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
- if (vp->v_type == VNON || (vp->v_iflag & VI_XLOCK)) {
+ if (vp->v_type == VNON || (vp->v_iflag & VI_DOOMED)) {
VI_UNLOCK(vp);
continue;
}
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c
index 681154d..2bbd124 100644
--- a/sys/gnu/ext2fs/ext2_vnops.c
+++ b/sys/gnu/ext2fs/ext2_vnops.c
@@ -277,31 +277,11 @@ ext2_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)
ext2_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_nlink == 0) {
- (void) vn_start_write(vp, &mp, V_WAIT);
- vrele(vp);
- vn_finished_write(mp);
- return (EAGAIN);
- }
- }
+ VI_UNLOCK(vp);
return (0);
}
@@ -668,12 +648,12 @@ ext2_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;
diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c
index ea3e642..2f48f9c 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode.c
@@ -499,7 +499,6 @@ ext2_inactive(ap)
}
}
out:
- VOP_UNLOCK(vp, 0, td);
/*
* If we are done with the inode, reclaim it
* so that it can be reused immediately.
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index b258065..1e73e12 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -536,20 +536,13 @@ loop:
MNT_ILOCK(mp);
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
- if (vp->v_iflag & VI_XLOCK) {
+ if (vp->v_iflag & VI_DOOMED) {
VI_UNLOCK(vp);
continue;
}
MNT_IUNLOCK(mp);
/*
- * Step 4: invalidate all inactive vnodes.
- */
- if (vp->v_usecount == 0) {
- vgonel(vp, td);
- goto loop;
- }
- /*
- * Step 5: invalidate all cached file data.
+ * Step 4: invalidate all cached file data.
*/
if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td)) {
goto loop;
@@ -557,7 +550,7 @@ loop:
if (vinvalbuf(vp, 0, td, 0, 0))
panic("ext2_reload: dirty2");
/*
- * Step 6: re-read inode data for all active vnodes.
+ * Step 5: re-read inode data for all active vnodes.
*/
ip = VTOI(vp);
error =
@@ -857,7 +850,7 @@ ext2_sync(mp, waitfor, td)
loop:
MNT_VNODE_FOREACH(vp, mp, nvp) {
VI_LOCK(vp);
- if (vp->v_type == VNON || (vp->v_iflag & VI_XLOCK)) {
+ if (vp->v_type == VNON || (vp->v_iflag & VI_DOOMED)) {
VI_UNLOCK(vp);
continue;
}
diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c
index 681154d..2bbd124 100644
--- a/sys/gnu/fs/ext2fs/ext2_vnops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vnops.c
@@ -277,31 +277,11 @@ ext2_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)
ext2_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_nlink == 0) {
- (void) vn_start_write(vp, &mp, V_WAIT);
- vrele(vp);
- vn_finished_write(mp);
- return (EAGAIN);
- }
- }
+ VI_UNLOCK(vp);
return (0);
}
@@ -668,12 +648,12 @@ ext2_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;
OpenPOWER on IntegriCloud