mirage / mirage-block

Block implementations for mirage
ISC License
2 stars 10 forks source link

Add functor Make_safe_BLOCK #15

Closed djs55 closed 8 years ago

djs55 commented 8 years ago

The V1_LWT.BLOCK interface requires certain buffer preconditions are satisfied, including the buffers must be whole numbers of sectors in length. It's easy to forget to do this, with unpredictable results; sometimes it will work on one backend but then fail on another.

The Make_safe_BLOCK functor wraps read and write to check the preconditions and generate useful log and error messages.

Fixes [mirage/mirage#448]