O DIRECT

From PortaWiki

Jump to: navigation, search

Contents

Linux 2.6

512 byte blocks, 512byte aligned. Previous to 2.6, more stringent requirements (see below).

XFS

XFS has good support for O_DIRECT. In pre 2.6 kernels you could use xfsctl to get the right alignment and min block sizes to use with O_DIRECT on a XFS volume.

O_DIRECT on linux pre 2.6 with non XFS

Possible with NFS in some places - although programatically working out what IO size and alignment to use is.. umm... not really possible and you should instead guess.

Windows

You can call CreateFile with FILE_FLAG_NO_BUFFERING, which has similar alignment requirements to O_DIRECT on linux 2.4.

Note that errors show up in errors during WriteFile, not CreateFile.

Personal tools