Skip to content

Commit

Permalink
Update z_sync_writes_cnt in FreeBSD implementation for consistency
Browse files Browse the repository at this point in the history
Signed-off-by: Shaan Nobee <sniper111@gmail.com>
  • Loading branch information
shaan1337 committed Dec 5, 2021
1 parent a53d9af commit f02f991
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion module/os/freebsd/zfs/zfs_vnops_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -4742,9 +4742,23 @@ struct vop_fsync_args {
static int
zfs_freebsd_fsync(struct vop_fsync_args *ap)
{
znode_t *zp = VTOZ(ap->a_vp);
zfsvfs_t *zfsvfs = zp->z_zfsvfs;

ZFS_ENTER(zfsvfs);
ZFS_VERIFY_ZP(zp);
atomic_inc_32(&zp->z_sync_writes_cnt);
ZFS_EXIT(zfsvfs);

vop_stdfsync(ap);
return (zfs_fsync(VTOZ(ap->a_vp), 0, ap->a_td->td_ucred));
int error = (zfs_fsync(zp, 0, ap->a_td->td_ucred));

ZFS_ENTER(zfsvfs);
ZFS_VERIFY_ZP(zp);
atomic_dec_32(&zp->z_sync_writes_cnt);
ZFS_EXIT(zfsvfs);

return (error);
}

#ifndef _SYS_SYSPROTO_H_
Expand Down

0 comments on commit f02f991

Please sign in to comment.