(vfs_preallocate): check mc_global.vfs.preallocate_space before call.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2018-08-19 11:52:30 +03:00
parent 357711da33
commit 88d6157323
2 changed files with 2 additions and 4 deletions

View File

@ -650,9 +650,6 @@ vfs_preallocate (int dest_vfs_fd, off_t src_fsize, off_t dest_fsize)
void *dest_fd = NULL; void *dest_fd = NULL;
struct vfs_class *dest_class; struct vfs_class *dest_class;
if (!mc_global.vfs.preallocate_space)
return 0;
if (src_fsize == 0) if (src_fsize == 0)
return 0; return 0;

View File

@ -2367,7 +2367,8 @@ copy_file_file (file_op_total_context_t * tctx, file_op_context_t * ctx,
} }
/* try preallocate space; if fail, try copy anyway */ /* try preallocate space; if fail, try copy anyway */
while (vfs_preallocate (dest_desc, file_size, appending ? dst_stat.st_size : 0) != 0) while (mc_global.vfs.preallocate_space &&
vfs_preallocate (dest_desc, file_size, appending ? dst_stat.st_size : 0) != 0)
{ {
if (ctx->skip_all) if (ctx->skip_all)
{ {