summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-12-10 10:56:48 +0100
committerLudovic Courtès <ludo@gnu.org>2022-12-10 10:56:48 +0100
commitb129026e2e242e9068158ae6e6fcd8d7c5ea092e (patch)
treeac52d64670ae247fd54c2b9550c3ff0c15a7d17c /guix
parent591af24ade1021d91a3e7c62fcc7a8c90f00d4bb (diff)
deduplicate: Use 'sendfile' for small file copies.
* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile' instead of 'dump-port'. * tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"): New test.
Diffstat (limited to 'guix')
-rw-r--r--guix/store/deduplication.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm
index ab982e3b3d..9953675319 100644
--- a/guix/store/deduplication.scm
+++ b/guix/store/deduplication.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Caleb Ristvedt <caleb.ristvedt@cune.org>
-;;; Copyright © 2018-2021 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018-2022 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -262,7 +262,7 @@ down the road."
(deduplicate file (dump-and-compute-hash) #:store store)
(call-with-output-file file
(lambda (output)
- (dump-port input output size)))))
+ (sendfile output input size 0)))))
(define* (copy-file/deduplicate source target
#:key (store (%store-directory)))