2018-03-26 20:29:57 +01:00
|
|
|
From 8041435de7ed028a27ecca64302945ad455c69a6 Mon Sep 17 00:00:00 2001
|
|
|
|
From: "Darrick J. Wong" <darrick.wong@oracle.com>
|
|
|
|
Date: Mon, 5 Feb 2018 14:38:02 -0600
|
|
|
|
Subject: xfs_io: fix copy_file_range symbol name collision
|
|
|
|
|
|
|
|
glibc 2.27 has a copy_file_range wrapper, so we need to change our
|
|
|
|
internal function out of the way to avoid compiler warnings.
|
|
|
|
|
|
|
|
Reported-by: fredrik@crux.nu
|
|
|
|
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
|
|
|
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
|
|
|
|
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
|
|
|
|
---
|
|
|
|
io/copy_file_range.c | 11 ++++++++---
|
|
|
|
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
|
|
|
|
index d1dfc5a..99fba20 100644
|
|
|
|
--- a/io/copy_file_range.c
|
|
|
|
+++ b/io/copy_file_range.c
|
|
|
|
@@ -42,13 +42,18 @@ copy_range_help(void)
|
2018-02-26 12:40:51 +00:00
|
|
|
"));
|
|
|
|
}
|
|
|
|
|
2018-03-26 20:29:57 +01:00
|
|
|
+/*
|
|
|
|
+ * Issue a raw copy_file_range syscall; for our test program we don't want the
|
|
|
|
+ * glibc buffered copy fallback.
|
|
|
|
+ */
|
|
|
|
static loff_t
|
2018-02-26 12:40:51 +00:00
|
|
|
-copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
|
2018-03-26 20:29:57 +01:00
|
|
|
+copy_file_range_cmd(int fd, loff_t *src, loff_t *dst, size_t len)
|
2018-02-26 12:40:51 +00:00
|
|
|
{
|
2018-03-26 20:29:57 +01:00
|
|
|
loff_t ret;
|
|
|
|
|
|
|
|
do {
|
|
|
|
- ret = syscall(__NR_copy_file_range, fd, src, file->fd, dst, len, 0);
|
|
|
|
+ ret = syscall(__NR_copy_file_range, fd, src, file->fd, dst,
|
|
|
|
+ len, 0);
|
|
|
|
if (ret == -1) {
|
|
|
|
perror("copy_range");
|
|
|
|
return errno;
|
|
|
|
@@ -130,7 +135,7 @@ copy_range_f(int argc, char **argv)
|
2018-02-26 12:40:51 +00:00
|
|
|
copy_dst_truncate();
|
|
|
|
}
|
|
|
|
|
|
|
|
- ret = copy_file_range(fd, &src, &dst, len);
|
2018-03-26 20:29:57 +01:00
|
|
|
+ ret = copy_file_range_cmd(fd, &src, &dst, len);
|
2018-02-26 12:40:51 +00:00
|
|
|
close(fd);
|
|
|
|
return ret;
|
|
|
|
}
|
2018-03-26 20:29:57 +01:00
|
|
|
--
|
|
|
|
cgit v1.1
|
|
|
|
|