mirage / ocaml-fat

Read and write FAT format filesystems from OCaml
ISC License
26 stars 18 forks source link

fat bin using the block --buffered arg for connect #75

Closed ricarkol closed 6 years ago

ricarkol commented 6 years ago

mirage-block-unix.2.5.0 has an arg to specify the use of unbuffered IO (O_DIRECT flag on open) on connect, an optional --buffered. This change uses that instead of the current appending of "buffered:" in front of the file name. This fixes #64.

Also, was looking at mirage-block-solo5, and it doesn't implement the --buffered arg. The fat bin tool uses block-unix, so that's good, but we should really implement that arg in solo5.

Test:

[ocaml-fat]$ strace ./_build/install/default/bin/fat list --unbuffered test/fat.dat 2>&1 | grep open
...
open("test/fat.dat", O_RDWR|O_DIRECT)   = 4

[ocaml-fat]$ strace ./_build/install/default/bin/fat list test/fat.dat 2>&1 | grep open
...
open("test/fat.dat", O_RDWR)            = 4
samoht commented 6 years ago

Thanks! I am merging this to unbreak mirage/fat on 4.06, but a proper review from @djs55 would be appreciated.