From eedd9d0fe637517fd655c4cacdd335ce4959abf2 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Wed, 10 Oct 2012 16:24:16 +0100 Subject: [PATCH] Windows: avoid large writes during file layout. Avoid large buffered writes during file layout by flushing changes to disk by calling _commit() after each write. Signed-off-by: Jens Axboe --- os/windows/posix.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/os/windows/posix.c b/os/windows/posix.c index 24517729..11500e48 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -411,6 +411,9 @@ int posix_fallocate(int fd, off_t offset, off_t len) break; } + /* Don't allow Windows to cache the write: flush it to disk */ + _commit(fd); + bytes_remaining -= bytes_written; } -- 2.25.1