On Mon, Jan 15, 2007 at 05:36:09PM +0900, ITAGAKI Takahiro wrote:
> The attached is a patch to define O_DIRECT by ourselves on Windows,
> and to map O_DIRECT to FILE_FLAG_NO_BUFFERING.
>
> There will be a consistency in our support between Windows and other OSes
> that have O_DIRECT. Also, there is the following comment that says, I read,
> we should do so.
> | handle other flags? (eg FILE_FLAG_NO_BUFFERING/FILE_FLAG_WRITE_THROUGH)
>
> Is this worth doing? Do we need more performance reports for the change?
IIRC we've discussed this before at some point, and I think we came to
the conclusion that we shouldn't do it. However, things may have
changed :-)
FILE_FLAG_NO_BUFFERING requires that *all* I/O follows:
* File access must begin at offsets that are integer multples of the
volume sector size.
* File access must be for number of bytes that are integer multiples of
the volume sector size.
* Buffer addresses for read and write operations must be sector aligned.
I was under the impression that our code can in no way guarantee this.
Especially given that a typical NTFS drive can have anything from 512 to
4096 bytes if you use the GUI to format it, and larger sizes than that
when you use some SAN tools to do it.
(btw, we already map O_DSYNC to FILE_FLAG_WRITE_THROUGH)
//Magnus