From 9aea88ba4402238dc70ba35754c446f880971c6e Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 29 Nov 2022 18:35:25 +0100 Subject: [PATCH] FreeBSD: stop using buffer cache-only routines on sync Both vop_fsync and vfs_stdsync are effectively just costly no-ops as they only act on ->v_bufobj.bo_dirty et al, which are unused by zfs. Reviewed-by: Ryan Moeller Signed-off-by: Mateusz Guzik Closes #14157 --- module/os/freebsd/zfs/zfs_vfsops.c | 4 ---- module/os/freebsd/zfs/zfs_vnops_os.c | 1 - 2 files changed, 5 deletions(-) diff --git a/module/os/freebsd/zfs/zfs_vfsops.c b/module/os/freebsd/zfs/zfs_vfsops.c index ffe6317645..1063e6f759 100644 --- a/module/os/freebsd/zfs/zfs_vfsops.c +++ b/module/os/freebsd/zfs/zfs_vfsops.c @@ -438,10 +438,6 @@ zfs_sync(vfs_t *vfsp, int waitfor) dsl_pool_t *dp; int error; - error = vfs_stdsync(vfsp, waitfor); - if (error != 0) - return (error); - if ((error = zfs_enter(zfsvfs, FTAG)) != 0) return (error); dp = dmu_objset_pool(zfsvfs->z_os); diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c index 8a350ab498..f552531a52 100644 --- a/module/os/freebsd/zfs/zfs_vnops_os.c +++ b/module/os/freebsd/zfs/zfs_vnops_os.c @@ -4724,7 +4724,6 @@ static int zfs_freebsd_fsync(struct vop_fsync_args *ap) { - vop_stdfsync(ap); return (zfs_fsync(VTOZ(ap->a_vp), 0, ap->a_td->td_ucred)); }