summaryrefslogtreecommitdiffstats
path: root/src/partition
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-10-12 20:04:11 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-11-11 13:47:47 +0100
commit8c467ee8ef870d172b24e716130d7a0b6b882d6b (patch)
tree16f1bf9711b80a11fbc4e5400f3059925187b258 /src/partition
parentrepart: Use copy_bytes() instead of copy_bytes_full() (diff)
downloadsystemd-8c467ee8ef870d172b24e716130d7a0b6b882d6b.tar.xz
systemd-8c467ee8ef870d172b24e716130d7a0b6b882d6b.zip
repart: Use COPY_REFLINK in context_copy_blocks()
We might be copying between files without a loop device involved. In that case, a reflink is possible and will be much faster.
Diffstat (limited to 'src/partition')
-rw-r--r--src/partition/repart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/partition/repart.c b/src/partition/repart.c
index 94a87b9788..3a4f181370 100644
--- a/src/partition/repart.c
+++ b/src/partition/repart.c
@@ -3200,7 +3200,7 @@ static int context_copy_blocks(Context *context) {
log_info("Copying in '%s' (%s) on block level into future partition %" PRIu64 ".",
p->copy_blocks_path, FORMAT_BYTES(p->copy_blocks_size), p->partno);
- r = copy_bytes(p->copy_blocks_fd, target_fd, p->copy_blocks_size, 0);
+ r = copy_bytes(p->copy_blocks_fd, target_fd, p->copy_blocks_size, COPY_REFLINK);
if (r < 0)
return log_error_errno(r, "Failed to copy in data from '%s': %m", p->copy_blocks_path);