The fsync flag performs an fsync(2) on the output file before closing it. This will be useful for the ZFS test suite.
Sponsored by: iXsystems, Inc.
I am planning a followup to add the fdatasync flag, as well.
Looks good to me.
This uses up the last free bit, but that should be OK.
do you also need to check close(2) calls?
It's in the stack: https://reviews.freebsd.org/D21376
Committed as rS351770