]> wimlib.net Git - wimlib/commitdiff
unix_apply.c: preallocate space for regular files
authorEric Biggers <ebiggers3@gmail.com>
Thu, 15 Dec 2016 04:49:55 +0000 (20:49 -0800)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 15 Dec 2016 05:38:23 +0000 (21:38 -0800)
configure.ac
src/unix_apply.c

index 70b786814e665398dd529eafc0ab4cd0f6888083..46dd6f0f9cd531d9191b34285472f8e11301a5d3 100644 (file)
@@ -59,7 +59,7 @@ AM_CONDITIONAL([WINDOWS_NATIVE_BUILD], [test "$WINDOWS_NATIVE_BUILD" = "yes"])
 
 # Useful functions which we can do without.
 AC_CHECK_FUNCS([futimens utimensat flock mempcpy       \
-               openat fstatat readlinkat fdopendir])
+               openat fstatat readlinkat fdopendir posix_fallocate])
 
 # Header checks, most of which are only here to satisfy conditional includes
 # made by the libntfs-3g headers.
index 672f39e7788d3a336a2ec5ab7b8ed216e8b5e3f4..e2ba76f9edddbc4d7fe04fb643dd964e055e5354 100644 (file)
@@ -585,6 +585,9 @@ retry_create:
                return WIMLIB_ERR_OPEN;
        }
        filedes_init(&ctx->open_fds[ctx->num_open_fds++], fd);
+#ifdef HAVE_POSIX_FALLOCATE
+       posix_fallocate(fd, 0, blob->size);
+#endif
        return unix_create_hardlinks(inode, first_dentry, first_path, ctx);
 }