From f2bed8ffb9db5a591880bb753301ba695e839b71 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 9 Aug 2017 11:41:44 +0200 Subject: [PATCH] Use CopyFileRange from golang.org/x/sys/unix Use the CopyFileRange and Lsetxattr from golang.org/x/sys/unix instead of their counterparts from github.com/containerd/continuity/sysx. These are 1:1 replacements (except for the fd parameter types in CopyFileRange). This will eventually allow to remove these functions there as well. Signed-off-by: Tobias Klauser --- fs/copy_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/copy_linux.go b/fs/copy_linux.go index d1a5e48cb..efe4753e0 100644 --- a/fs/copy_linux.go +++ b/fs/copy_linux.go @@ -37,7 +37,7 @@ func copyFileContent(dst, src *os.File) error { return errors.Wrap(err, "unable to stat source") } - n, err := sysx.CopyFileRange(src.Fd(), nil, dst.Fd(), nil, int(st.Size()), 0) + n, err := unix.CopyFileRange(int(src.Fd()), nil, int(dst.Fd()), nil, int(st.Size()), 0) if err != nil { if err != unix.ENOSYS && err != unix.EXDEV { return errors.Wrap(err, "copy file range failed")