]> wimlib.net Git - wimlib/blobdiff - src/unix_apply.c
unix_apply.c: preallocate space for regular files
[wimlib] / src / unix_apply.c
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);
 }