Blame SOURCES/use-sendfile.patch
|
|
e1207c |
From acda1b0d97fa9e2a3ea3a51619d30d7f2d0f7244 Mon Sep 17 00:00:00 2001
|
|
|
e1207c |
From: Christian Kellner <christian@kellner.me>
|
|
|
e1207c |
Date: Tue, 26 Mar 2019 17:52:28 +0100
|
|
|
e1207c |
Subject: [PATCH] common: use sendfile instead of copy_file_range
|
|
|
e1207c |
|
|
|
e1207c |
On older kernels we cannot use copy_file_range so use sendfile
|
|
|
e1207c |
instead.
|
|
|
e1207c |
---
|
|
|
e1207c |
common/bolt-io.c | 3 ++-
|
|
|
e1207c |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
e1207c |
|
|
|
e1207c |
diff --git a/common/bolt-io.c b/common/bolt-io.c
|
|
|
e1207c |
index 5e50afa..375f978 100644
|
|
|
e1207c |
--- a/common/bolt-io.c
|
|
|
e1207c |
+++ b/common/bolt-io.c
|
|
|
e1207c |
@@ -26,6 +26,7 @@
|
|
|
e1207c |
#include <fcntl.h>
|
|
|
e1207c |
#include <errno.h>
|
|
|
e1207c |
#include <sys/types.h>
|
|
|
e1207c |
+#include <sys/sendfile.h>
|
|
|
e1207c |
#include <sys/stat.h>
|
|
|
e1207c |
#include <stdio.h>
|
|
|
e1207c |
#include <string.h>
|
|
|
e1207c |
@@ -831,7 +832,7 @@ bolt_copy_bytes (int fd_from,
|
|
|
e1207c |
{
|
|
|
e1207c |
ssize_t r;
|
|
|
e1207c |
|
|
|
e1207c |
- r = copy_file_range (fd_from, NULL, fd_to, NULL, len, 0);
|
|
|
e1207c |
+ r = sendfile (fd_to, fd_from, NULL, len);
|
|
|
e1207c |
|
|
|
e1207c |
if (r == -1)
|
|
|
e1207c |
{
|
|
|
e1207c |
--
|
|
|
e1207c |
2.20.1
|
|
|
e1207c |
|