summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-02-08 18:09:11 +0000
committerphk <phk@FreeBSD.org>2005-02-08 18:09:11 +0000
commita75e6a71107531e1b94a6814e1567f9f3d7bb655 (patch)
tree74f26d1c750365766d00443a4a6215c3dda4ede5
parentcc21fc94e937c01b8c5b55ca7fbc8881f5156b62 (diff)
downloadFreeBSD-src-a75e6a71107531e1b94a6814e1567f9f3d7bb655.zip
FreeBSD-src-a75e6a71107531e1b94a6814e1567f9f3d7bb655.tar.gz
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.
-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 81a3235..8c2c8b6 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 81a3235..8c2c8b6 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 3fe3b9d..fb6281a 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 a9f1310..55c3035 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 c800cb5..942a7e2 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);
}
OpenPOWER on IntegriCloud