aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2021-01-03 00:58:43 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2021-01-03 00:58:43 +0000
commitc98a764c681f8b70812a9f13a6e61c96aa1a69d2 (patch)
treea01afea7c27ed16865d1147e1db08f41b8ba6232 /lib/libc
parent9c43bd646e27241dca95958a84ea4d6948d2531d (diff)
downloadsrc-c98a764c681f8b70812a9f13a6e61c96aa1a69d2.tar.gz
src-c98a764c681f8b70812a9f13a6e61c96aa1a69d2.zip
cp(1): fix performance issue for large non-sparse file copies
PR252358 reported a serious performance problem when copying a large non-sparse file on a UFS file system. This problem seems to have been caused by a large number of SEEK_HOLE operations, with one done for each copy_file_range(2) call. This patch modifies cp(1) to use a large (SSIZE_MAX) len argument, reducing the number of system calls and resolving the performance issue. While here, convert the type of the "rcount" from "int" to "ssize_t" so that it is consistent with that returned by both read(2) and copy_file_range(2). PR: 252358 Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D27937
Diffstat (limited to 'lib/libc')
0 files changed, 0 insertions, 0 deletions