aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-02-05 14:38:02 -0600
committerEric Sandeen <sandeen@redhat.com>2018-02-05 14:38:02 -0600
commit8041435de7ed028a27ecca64302945ad455c69a6 (patch)
treed2739bc7d2042a52b7450195473a67c9392d753b
parent33a503423d5fa11316aeb71b6e136aa3583df38d (diff)
downloadxfsprogs-dev-8041435de7ed028a27ecca64302945ad455c69a6.tar.gz
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>
-rw-r--r--io/copy_file_range.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index d1dfc5a5e3..99fba20a49 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -42,13 +42,18 @@ copy_range_help(void)
"));
}
+/*
+ * Issue a raw copy_file_range syscall; for our test program we don't want the
+ * glibc buffered copy fallback.
+ */
static loff_t
-copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
+copy_file_range_cmd(int fd, loff_t *src, loff_t *dst, size_t len)
{
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)
copy_dst_truncate();
}
- ret = copy_file_range(fd, &src, &dst, len);
+ ret = copy_file_range_cmd(fd, &src, &dst, len);
close(fd);
return ret;
}