Checkpoint commit of O_DIRECT experiment

Opening a file with O_DIRECT seems to be incompatible with
some of the other operations lwt performs internally, resulting
in EINVAL. More debugging needed.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Fix the fcntl.h #include

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Use of O_DIRECT is now optional

We use aligned I/O whether using buffering or not.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
streaming: cache the last read bitmap, per vhd, to optimise for sequential reading

Optimising for random access will require more sophisticated
bitmap handling.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Improve performance by coalescing as much I/O as possible

When writing blocks, avoid chunking them into individual sectors.

For the special case of writing empty blocks, perform the writes
in multiples of 2MiB if possible.

When verifying data, large chunks and then split into sectors
in-memory.

Signed-off-by: David Scott <dave.scott@eu.citrix.com>
Switch to O_DIRECT by default

The absolute performance of both O_DIRECT and regular buffered
are similar, so we default to O_DIRECT because it avoids polluting
caches when streaming large disks (which is one of the main
use-cases)

Signed-off-by: David Scott <dave.scott@eu.citrix.com>