Skip to content

Conversation

@djs55
Copy link
Member

@djs55 djs55 commented Mar 6, 2016

  • use fsync rather than open with O_DIRECT
  • there's no need for blkgetsize64 since there are no block device files
  • use open, lseek, write instead of dd in the tests
  • leave resize unimplemented for now

djs55 added 5 commits March 6, 2016 17:42
Ideally we want to open the file in raw mode to behave more like a
Xen unikernel, where

- data is persisted as soon as `write` returns (and not pending in
  some write back cache)
- data is only copied if we ask for it (and are happy with the
  implications)
- caches are only used if they're linked into the program

On Linux and OSX it's quite straightforward to open files in raw
mode with flags O_DIRECT and F_NOCACHE. On Win32 the APIs are
completely different.

As an initial starting point, this patch adds a Win32 implementation
which opens the file as normal but calls `fsync` after every `write`.
This gains the persistence property, but still causes data to be
copied and cached.

Signed-off-by: David Scott <dave.scott@docker.com>
Only Unix has the notion of a block device as a file; Windows
will never need a `blkgetsize64`.

Signed-off-by: David Scott <dave.scott@docker.com>
This removes the only deprecation warning.

Signed-off-by: David Scott <dave.scott@docker.com>
This is simpler and more portable.

Note that `ftruncate` isn't implemented in Lwt for Win32,
see mirage#42.

Signed-off-by: David Scott <dave.scott@docker.com>
See mirage#42

Signed-off-by: David Scott <dave.scott@docker.com>
@djs55
Copy link
Member Author

djs55 commented Mar 6, 2016

Appveyor only failed because it isn't configured yet

djs55 added a commit that referenced this pull request Mar 6, 2016
@djs55 djs55 merged commit 5a12da5 into mirage:master Mar 6, 2016
@djs55 djs55 deleted the improvements branch March 6, 2016 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant