Windows: avoid large writes during file layout.
authorBruce Cran <bruce@cran.org.uk>
Wed, 10 Oct 2012 15:24:16 +0000 (16:24 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Oct 2012 15:36:29 +0000 (09:36 -0600)
Avoid large buffered writes during file layout by flushing changes to disk by
calling _commit() after each write.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/windows/posix.c

index 245177298f5307502bf8bbb563d34ad4f323ffc1..11500e480bf85a1c5b2f45c7defa2d63f81a56bb 100755 (executable)
@@ -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;
        }