summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-07-01 17:59:40 +0000
committeriedowse <iedowse@FreeBSD.org>2002-07-01 17:59:40 +0000
commit4416f8270661dceb52114032c53cec62128437ba (patch)
tree7246cde7ca751937ee5b54600c6dac369be7343e /sys/kern/vfs_extattr.c
parente0bb05d58f498891539629141628e1518dcd9124 (diff)
downloadFreeBSD-src-4416f8270661dceb52114032c53cec62128437ba.zip
FreeBSD-src-4416f8270661dceb52114032c53cec62128437ba.tar.gz
Use indirect function pointer hooks instead of #ifdef SOFTUPDATES
direct calls for the two places where the kernel calls into soft updates code. Set up the hooks in softdep_initialize() and NULL them out in softdep_uninitialize(). This change allows soft updates to function correctly when ufs is loaded as a module. Reviewed by: mckusick
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 1244e54..8fcb651 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -41,7 +41,6 @@
/* For 4.3 integer FS ID compatibility */
#include "opt_compat.h"
-#include "opt_ffs.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -92,6 +91,7 @@ static int vfs_nmount(struct thread *td, int, struct uio *);
static int usermount = 0; /* if 1, non-root can mount fs. */
int (*union_dircheckp)(struct thread *td, struct vnode **, struct file *);
+int (*softdep_fsync_hook)(struct vnode *);
SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0, "");
@@ -3486,10 +3486,9 @@ fsync(td, uap)
vm_object_page_clean(obj, 0, 0, 0);
}
error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, td);
-#ifdef SOFTUPDATES
- if (error == 0 && vp->v_mount && (vp->v_mount->mnt_flag & MNT_SOFTDEP))
- error = softdep_fsync(vp);
-#endif
+ 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);
OpenPOWER on IntegriCloud