Zbigniew Jędrzejewski-Szmek
00a8cf7763
basic/copy: use sendfile smarter
...
We called sendfile with 16kb (a.k.a. COPY_BUFFER_SIZE) as the maximum
number of bytes to copy. This seems rather inefficient, especially with
large files. Instead, call sendfile with a "large" maximum.
What "large" max means is a bit tricky: current file offset + max
must fit in loff_t. This means that as we call sendfile more than once,
we have to lower the max size.
With this patch, test-copy calls sendfile twice, e.g.:
sendfile(4, 3, NULL, 9223372036854775807) = 738760
sendfile(4, 3, NULL, 9223372036854037047) = 0
The second call is necessary to determine EOF.
2016-03-15 14:54:27 -04:00
..
2016-02-10 13:41:57 +01:00
2016-02-22 20:32:04 -08:00
2016-02-25 15:29:59 -05:00
2016-03-01 19:02:11 +01:00
2016-02-10 13:41:57 +01:00
2016-03-15 14:54:27 -04:00
2016-02-10 13:41:57 +01:00
2016-02-23 14:20:34 -08:00
2016-02-26 01:13:23 +06:00
2016-02-10 13:41:57 +01:00
2016-02-13 12:28:28 +01:00
2016-03-14 08:31:08 -04:00
2016-02-25 15:29:59 -05:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-25 15:29:59 -05:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-03-06 13:27:59 +06:00
2016-02-10 13:41:57 +01:00
2016-03-04 22:09:08 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-03-01 20:39:30 -05:00
2015-11-27 19:19:36 +01:00
2016-02-21 20:40:57 +01:00
2016-02-22 20:32:04 -08:00
2016-03-04 21:46:47 -05:00
2016-02-23 14:20:34 -08:00
2016-03-05 18:26:01 +06:00
2016-03-09 21:58:44 -08:00
2016-02-22 20:32:04 -08:00
2016-03-01 20:39:30 -05:00
2016-03-01 20:39:30 -05:00
2016-02-25 15:29:59 -05:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-03-09 21:58:44 -08:00
2016-02-10 13:41:57 +01:00
2016-03-09 11:19:45 -05:00
2016-02-10 13:41:57 +01:00
2016-02-22 20:32:04 -08:00
2016-02-22 20:32:04 -08:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-02-13 12:28:28 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-03-05 18:26:01 +06:00
2016-02-10 13:41:57 +01:00
2016-03-12 11:50:34 +01:00
2016-03-14 00:54:35 +00:00
2016-02-10 13:41:57 +01:00
2016-02-22 20:32:04 -08:00
2016-02-29 10:45:34 +01:00
2016-02-10 13:41:57 +01:00
2016-02-10 13:41:57 +01:00
2016-03-07 14:50:08 +01:00
2016-03-09 21:58:44 -08:00
2016-03-01 20:39:30 -05:00
2016-02-23 14:20:34 -08:00
2016-03-15 14:53:31 -04:00
2016-03-01 20:39:30 -05:00
2016-02-26 11:28:49 +01:00
2016-03-05 18:26:01 +06:00
2016-02-10 16:53:49 +01:00
2016-03-01 20:39:30 -05:00
2016-03-01 20:39:30 -05:00
2016-02-10 13:41:57 +01:00
2016-03-01 20:39:30 -05:00
2016-02-10 13:41:57 +01:00