summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-05-01 21:50:49 +0100
committerPádraig Brady <P@draigBrady.com>2012-05-02 18:41:53 +0100
commit15f1d0c9aad23f5ada64594c127ca015d4d8dbfe (patch)
tree7502b6f0a3ca2b3e0b26f0686aec1e6a240534c6 /src
parente744f4b7b7de9b76fdd314aa406e9fb150b9168d (diff)
downloadcoreutils-15f1d0c9aad23f5ada64594c127ca015d4d8dbfe.tar.xz
cp,mv,install: provide POSIX_FADV_SEQUENTIAL hint to input
This was inadvertently omitted from v8.5-104-g47076e3, and gives the same 5% speedup when copying from an SSD. * src/copy.c (copy_internal): Apply the FADVISE_SEQUENTIAL hint.
Diffstat (limited to 'src')
-rw-r--r--src/copy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/copy.c b/src/copy.c
index 26bbcf22e..844ebcd78 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -39,6 +39,7 @@
#include "cp-hash.h"
#include "extent-scan.h"
#include "error.h"
+#include "fadvise.h"
#include "fcntl--.h"
#include "fiemap.h"
#include "file-set.h"
@@ -980,6 +981,8 @@ copy_reg (char const *src_name, char const *dst_name,
size_t buf_alignment_slop = sizeof (word) + buf_alignment - 1;
size_t buf_size = io_blksize (sb);
+ fdadvise (source_desc, 0, 0, FADVISE_SEQUENTIAL);
+
/* Deal with sparse files. */
bool make_holes = false;
bool sparse_src = false;