On Thu, Mar 19, 2009 at 08:17:53PM +0530, Amit Shah wrote:
Using posix_fallocate() to allocate disk space and fill it with zeros is
faster
than writing the zeros block-by-block.
Also, for backing file systems that support extents and the fallocate()
syscall,
this operation will give us a
Using posix_fallocate() to allocate disk space and fill it with zeros is faster
than writing the zeros block-by-block.
Also, for backing file systems that support extents and the fallocate() syscall,
this operation will give us a big speed boost.
This also brings us the advantage of very less
Using posix_fallocate() to allocate disk space and fill it with zeros is faster
than writing the zeros block-by-block.
Also, for backing file systems that support extents and the fallocate() syscall,
this operation will give us a big speed boost.
This also brings us the advantage of very less
On (Thu) Mar 19 2009 [10:39:05], Daniel P. Berrange wrote:
On Thu, Mar 19, 2009 at 12:45:24PM +0530, Amit Shah wrote:
diff --git a/src/util.c b/src/util.c
index 66ad9a4..b69d33a 100644
--- a/src/util.c
+++ b/src/util.c
@@ -117,6 +117,26 @@ ssize_t safewrite(int fd, const void *buf,
On Thu, Mar 19, 2009 at 05:02:48PM +0530, Amit Shah wrote:
On (Thu) Mar 19 2009 [10:39:05], Daniel P. Berrange wrote:
char * buf = mmap(NULL, len, MAP_SHARED, MAP_ANONYMOUS, fd, offset)
memset(buf, 0, len);
munmap(buf, len);
Or, do your calloc() of a 1 MB chunk, and then call
Using posix_fallocate() to allocate disk space and fill it with zeros is faster
than writing the zeros block-by-block.
Also, for backing file systems that support extents and the fallocate() syscall,
this operation will give us a big speed boost.
This also brings us the advantage of very less