aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2009-01-29 11:38:28 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2009-01-29 11:38:28 +0000
commite8b10b2a053cc3ab9215d9ce7687d7daf1152667 (patch)
treed2c94339f5ec6bf6a0fa3b1534b823dd5fb43877
parent9f1678c2ec944bad9531780cbaba2586f419d202 (diff)
Notes
-rw-r--r--sys/gnu/fs/ext2fs/ext2_inode.c12
-rw-r--r--sys/kern/vfs_vnops.c50
-rw-r--r--sys/sys/vnode.h2
3 files changed, 2 insertions, 62 deletions
diff --git a/sys/gnu/fs/ext2fs/ext2_inode.c b/sys/gnu/fs/ext2fs/ext2_inode.c
index 04a9d46300ce..086f73957976 100644
--- a/sys/gnu/fs/ext2fs/ext2_inode.c
+++ b/sys/gnu/fs/ext2fs/ext2_inode.c
@@ -481,7 +481,6 @@ ext2_inactive(ap)
if (ip->i_mode == 0)
goto out;
if (ip->i_nlink <= 0) {
- (void) vn_write_suspend_wait(vp, NULL, V_WAIT);
error = ext2_truncate(vp, (off_t)0, 0, NOCRED, td);
ip->i_rdev = 0;
mode = ip->i_mode;
@@ -489,15 +488,8 @@ ext2_inactive(ap)
ip->i_flag |= IN_CHANGE | IN_UPDATE;
ext2_vfree(vp, ip->i_number, mode);
}
- if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE)) {
- if ((ip->i_flag & (IN_CHANGE | IN_UPDATE | IN_MODIFIED)) == 0 &&
- vn_write_suspend_wait(vp, NULL, V_NOWAIT)) {
- ip->i_flag &= ~IN_ACCESS;
- } else {
- (void) vn_write_suspend_wait(vp, NULL, V_WAIT);
- ext2_update(vp, 0);
- }
- }
+ if (ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED | IN_UPDATE))
+ ext2_update(vp, 0);
out:
/*
* If we are done with the inode, reclaim it
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 16451721af69..c191a214247b 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -943,56 +943,6 @@ unlock:
* time, these operations are halted until the suspension is over.
*/
int
-vn_write_suspend_wait(vp, mp, flags)
- struct vnode *vp;
- struct mount *mp;
- int flags;
-{
- int error;
-
- if (vp != NULL) {
- if ((error = VOP_GETWRITEMOUNT(vp, &mp)) != 0) {
- if (error != EOPNOTSUPP)
- return (error);
- return (0);
- }
- }
- /*
- * If we are not suspended or have not yet reached suspended
- * mode, then let the operation proceed.
- */
- if (mp == NULL)
- return (0);
- MNT_ILOCK(mp);
- if (vp == NULL)
- MNT_REF(mp);
- if ((mp->mnt_kern_flag & MNTK_SUSPENDED) == 0) {
- MNT_REL(mp);
- MNT_IUNLOCK(mp);
- return (0);
- }
- if (flags & V_NOWAIT) {
- MNT_REL(mp);
- MNT_IUNLOCK(mp);
- return (EWOULDBLOCK);
- }
- /*
- * Wait for the suspension to finish.
- */
- error = msleep(&mp->mnt_flag, MNT_MTX(mp),
- (PUSER - 1) | (flags & PCATCH) | PDROP, "suspfs", 0);
- vfs_rel(mp);
- return (error);
-}
-
-/*
- * Secondary suspension. Used by operations such as vop_inactive
- * routines that are needed by the higher level functions. These
- * are allowed to proceed until all the higher level functions have
- * completed (indicated by mnt_writeopcount dropping to zero). At that
- * time, these operations are halted until the suspension is over.
- */
-int
vn_start_secondary_write(vp, mpp, flags)
struct vnode *vp;
struct mount **mpp;
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 68989566ec1e..5ac413100ace 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -625,8 +625,6 @@ int vn_stat(struct vnode *vp, struct stat *sb, struct ucred *active_cred,
int vn_start_write(struct vnode *vp, struct mount **mpp, int flags);
int vn_start_secondary_write(struct vnode *vp, struct mount **mpp,
int flags);
-int vn_write_suspend_wait(struct vnode *vp, struct mount *mp,
- int flags);
int vn_writechk(struct vnode *vp);
int vn_extattr_get(struct vnode *vp, int ioflg, int attrnamespace,
const char *attrname, int *buflen, char *buf, struct thread *td);