Rick Macklem c98a764c68 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
2021-01-02 16:58:43 -08:00
..
2020-07-26 15:10:33 +00:00
2020-10-29 14:44:09 +00:00
2018-11-04 17:56:16 +00:00
2020-10-05 13:49:45 +00:00
2020-12-27 22:32:22 +01:00
2020-10-24 16:42:35 +00:00
2017-10-31 00:07:04 +00:00
2020-12-12 02:26:43 +00:00
2020-12-27 22:32:22 +01:00
2017-10-31 00:07:04 +00:00
2020-12-22 21:04:36 -08:00
2017-10-06 08:43:14 +00:00