]> Cypherpunks repositories - gostls13.git/commit
internal/poll: drop redundant ENOSYS and EXDEV error checks in CopyFileRange()
authorAndy Pan <panjf2000@gmail.com>
Sat, 27 Aug 2022 02:44:25 +0000 (10:44 +0800)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 5 Sep 2022 08:10:03 +0000 (08:10 +0000)
commit40ced0c00b04a5b9832bb5b47c995c82854f26ae
tree4630e8e2bc753ba4d27ec25f2ca2b6f987d8657c
parentaf7f417665fb1612eb9865c7ab4992bf095148e2
internal/poll: drop redundant ENOSYS and EXDEV error checks in CopyFileRange()

The initial CL 229101 didn't limit the kernel version, but relies on error checking to
ensure the kernel version >= 4.5 or >= 5.3 when it's calling copy_file_range(2) to copy data across file systems.

Since we have now put the kernel version checking at the beginning of the function, introduced by CL 268338,
which returns early instead of going forward to the code behind when the kernel verion is older than 5.3,
therefore, those subsequent related error checks are no longer needed.

Change-Id: Ifc4a530723e21f0bde91d6420cde9cb676081922
Reviewed-on: https://go-review.googlesource.com/c/go/+/425881
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: hopehook <hopehook@golangcn.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Heschi Kreinick <heschi@google.com>
src/internal/poll/copy_file_range_linux.go