From: Eric Biggers Date: Thu, 15 Dec 2016 04:49:55 +0000 (-0800) Subject: unix_apply.c: preallocate space for regular files X-Git-Tag: v1.11.0~43 X-Git-Url: https://wimlib.net/git/?a=commitdiff_plain;h=bb499ce3ea390ce3bd9b334ab5817015247d4b47;hp=7feaf956208f74543f48c646acc4cbec424ae3cc;p=wimlib unix_apply.c: preallocate space for regular files --- diff --git a/configure.ac b/configure.ac index 70b78681..46dd6f0f 100644 --- a/configure.ac +++ b/configure.ac @@ -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. diff --git a/src/unix_apply.c b/src/unix_apply.c index 672f39e7..e2ba76f9 100644 --- a/src/unix_apply.c +++ b/src/unix_apply.c @@ -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); }