aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-02-08 18:09:11 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-02-08 18:09:11 +0000
commit88e5b12a2020751dfd3368cd88268be36109dbab (patch)
tree74f26d1c750365766d00443a4a6215c3dda4ede5
parent7990a18c7b5282ac60ca86c478772d24c169f22f (diff)
downloadsrc-88e5b12a2020751dfd3368cd88268be36109dbab.tar.gz
src-88e5b12a2020751dfd3368cd88268be36109dbab.zip
Drag another softupdates tentacle back into FFS: Now that FFS's
vop_fsync is separate from the internal use we can do the full job there.
Notes
Notes: svn path=/head/; revision=141533
-rw-r--r--sys/kern/vfs_extattr.c4
-rw-r--r--sys/kern/vfs_syscalls.c4
-rw-r--r--sys/sys/vnode.h1
-rw-r--r--sys/ufs/ffs/ffs_softdep.c2
-rw-r--r--sys/ufs/ffs/ffs_vnops.c7
5 files changed, 7 insertions, 11 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 81a3235f3421..8c2c8b62a8ba 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -89,7 +89,6 @@ static int extattr_list_vp(struct vnode *vp, int attrnamespace, void *data,
size_t nbytes, struct thread *td);
int (*union_dircheckp)(struct thread *td, struct vnode **, struct file *);
-int (*softdep_fsync_hook)(struct vnode *);
/*
* The module initialization routine for POSIX asynchronous I/O will
@@ -3149,9 +3148,6 @@ fsync(td, uap)
VM_OBJECT_UNLOCK(vp->v_object);
}
error = VOP_FSYNC(vp, MNT_WAIT, td);
- if (error == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP)
- && softdep_fsync_hook != NULL)
- error = (*softdep_fsync_hook)(vp);
VOP_UNLOCK(vp, 0, td);
vn_finished_write(mp);
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 81a3235f3421..8c2c8b62a8ba 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -89,7 +89,6 @@ static int extattr_list_vp(struct vnode *vp, int attrnamespace, void *data,
size_t nbytes, struct thread *td);
int (*union_dircheckp)(struct thread *td, struct vnode **, struct file *);
-int (*softdep_fsync_hook)(struct vnode *);
/*
* The module initialization routine for POSIX asynchronous I/O will
@@ -3149,9 +3148,6 @@ fsync(td, uap)
VM_OBJECT_UNLOCK(vp->v_object);
}
error = VOP_FSYNC(vp, MNT_WAIT, td);
- if (error == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP)
- && softdep_fsync_hook != NULL)
- error = (*softdep_fsync_hook)(vp);
VOP_UNLOCK(vp, 0, td);
vn_finished_write(mp);
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 3fe3b9d08b6f..fb6281ab52f7 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -568,7 +568,6 @@ struct vattr;
struct vnode;
extern int (*lease_check_hook)(struct vop_lease_args *);
-extern int (*softdep_fsync_hook)(struct vnode *);
extern int (*softdep_process_worklist_hook)(struct mount *);
/* cache_* may belong in namei.h. */
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index a9f13104c697..55c303521b83 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -987,7 +987,6 @@ softdep_initialize()
/* hooks through which the main kernel code calls us */
softdep_process_worklist_hook = softdep_process_worklist;
- softdep_fsync_hook = softdep_fsync;
/* initialise bioops hack */
bioops.io_start = softdep_disk_io_initiation;
@@ -1006,7 +1005,6 @@ softdep_uninitialize()
{
softdep_process_worklist_hook = NULL;
- softdep_fsync_hook = NULL;
hashdestroy(pagedep_hashtbl, M_PAGEDEP, pagedep_hash);
hashdestroy(inodedep_hashtbl, M_INODEDEP, inodedep_hash);
hashdestroy(newblk_hashtbl, M_NEWBLK, newblk_hash);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index c800cb5e8ed0..942a7e2c5fc4 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -160,6 +160,13 @@ ffs_fsync(struct vop_fsync_args *ap)
int error;
error = ffs_syncvnode(ap->a_vp, ap->a_waitfor);
+#ifdef SOFTUPDATES
+ if (error)
+ return (error);
+ if (ap->a_waitfor == MNT_WAIT &&
+ (ap->a_vp->v_mount->mnt_flag & MNT_SOFTDEP))
+ error = softdep_fsync(ap->a_vp);
+#endif
return (error);
}