Any point in using O_FSYNC on open()?

Can anyone tell me if there is any point in using the O_FSYNC flag when opening files on disks in FreeBSD since FreeBSD sees disks as character devices rather than block devices? I see the flag is still available.

From what I've read, the buffer cache for disks was removed in FreeBSD post ver 3.x.
 
What should it have to do with block devices? Just expect that it works as documented regardless of the underlying type in the fs.
 
There are other caches in the system, so I'd assume it still does something. (For one thing, I believe writes are kept in memory a bit to allow gathering them into more effective disk operations.)
 
afaik that's not allowed with O_FSYNC. What the system does depends on the underlying FS. So there are differences for UFS or UFS+Softupdates or ZFS.
 
@jostrowski: Exactly. What was removed was buffer cache, which was a cache below the filesystem. What is left is page cache, which is a cache above the filesystem. So, data is still being buffered in memory. The buffer cache was just redundant, so got removed.
 
Back
Top