Link: 
http://searchstorage.techtarget.com/tip/1,289483,sid5_gci920473,00.html

Quote: "FlushFileBuffers is an API call that forces all data for an open 
file handle to be flushed from the system cache and also sends a command to 
the disk to flush its cache (contrary to the name, this call affects all 
data stored in the device cache)"

So FlushFileBuffers flushes ALL writes to disk, not just those of the 
specified file handle.

According to that article, it looks like the recommended way to achieve good 
performance and integrity is to use FILE_FLAG_WRITE_THROUGH, not 
FlushFileBuffers.

Quote: "FILE_FLAG_WRITE_THROUGH indicates that a device may not complete a 
write request until the data is committed to media. This is enforced through 
the use of the FUA flag"

Then this flag should be enabled when writing to the journal log:
Quote: "FILE_FLAG_SEQUENTIAL_SCAN informs the file system that the file will 
be accessed sequentially. This allows the file system to be more aggressive 
in caching and perform read ahead/write behind operations and also 
flushing/discarding buffers once the I/O has progressed beyond the location 
of the file contained within the buffer. Benchmarks have shown that 
FILE_FLAG_SEQUENTIAL_SCAN provides a negligible improvement in read 
throughput, but provides a noticeable improvement in write throughput."

/Ludvig

Reply via email to