git.samba.org
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e9ee19
)
Avoid preallocation on inplace file that is already long enough.
author
Wayne Davison
<wayned@samba.org>
Sun, 2 Jun 2013 19:37:48 +0000
(12:37 -0700)
committer
Wayne Davison
<wayned@samba.org>
Sun, 2 Jun 2013 19:37:48 +0000
(12:37 -0700)
receiver.c
patch
|
blob
|
history
diff --git
a/receiver.c
b/receiver.c
index 5ba370bacc5eda82d5d621e9a51d121fe89a890f..622f462a3bd7440f648c7734fb2f838db9bc9b11 100644
(file)
--- a/
receiver.c
+++ b/
receiver.c
@@
-241,7
+241,7
@@
static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
OFF_T preallocated_len = 0;
#endif
- if (preallocate_files && fd != -1 && total_size > 0) {
+ if (preallocate_files && fd != -1 && total_size > 0
&& (!inplace || total_size > size_r)
) {
/* Try to preallocate enough space for file's eventual length. Can
* reduce fragmentation on filesystems like ext4, xfs, and NTFS. */
if (do_fallocate(fd, 0, total_size) == 0) {