1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 19:34:05 +00:00
transmission/libtransmission
RobCrowston 0155252823
Add in-kernel file copying for several platforms. (#1092)
* Add in-kernel copying support for Linux (sendfile64(2), copy_file_range(2)), FreeBSD 13 (copy_file_range(2)), MacOS (copyfile(2)), and Windows (CopyFileExA).

* Fix macro name USE_COPY_FILE_RANGE.

* Minor bugfixes for userspace fallback.

* Fix linux sendfile64 bugs.

* Remove some overzealous asserts.

* Allow transmission-test-copy to take an optional argument for an external reference file.

* Fix return value error of tr_sys_path_copy.

* Use COPYFILE_ALL for Macs without COPYFILE_CLONE.

* Add in-kernel file copying for several platforms.

Numerous operating systems now have support for copying files directly in the
kernel, which is generally more efficient than copying in a userspace read(2)/
write(2) loop. (This becomes particularly relevant for 4th gen PCI-E storage,
which approaches the latency of DRAM.) For Linux I use sendfile64(2), and, for
later kernels, copy_file_range(2). FreeBSD 13 will also support
copy_file_range(2). MacOS has copyfile(2), and Windows has CopyFileExA.
Operating systems lacking such a syscall continue to use the existing
read(2)/write(2) loop.

* Appease uncrustify.

* Appease uncrustify.

* copy-test: generate random content at run time.

* copy-test: Stylistic changes and more check()s.

* copy-test: files_are_identical should follow test idioms

* tr_sys_path_copy: numerous tweaks as requested by review.

* s/old file/source file; s/new file/destination file.

* tr_sys_path_copy: handle win32 wide characters in paths.

* Uncrustify.

* test-copy: Use non-string create_file_with_contents.

* tr_sys_path_copy: numerous fixes.

Per review: generate test file content at runtime; tidy use of check();
fix style; re-measure file sizes in the copy; define a macro when the
system does not provide it; use Unicode APIs on Windows; and fix
documentation.

* Updated as per comments.

* Rebase kernel-copy changes onto 3.0 with gtest.

* Undo irrelevant comment change.

* Fix syntax error.

* Use tr_malloc() instead of tr_valloc().

* Use EXPECT instead of TR_ASSERT in gtest.

* Add error handling.

* Acceptable coding style has changed again.

Now it's camelCase. Also use nullptr instead of NULL, etc.

* Fix east/west const.

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2021-08-07 12:04:03 +03:00
..
announcer-common.h
announcer-http.c
announcer-udp.c
announcer.c
announcer.h
bandwidth.c
bandwidth.h
bitfield.c
bitfield.h
blocklist.c
blocklist.h
cache.c
cache.h
clients.c
clients.h
CMakeLists.txt
completion.c
completion.h
ConvertUTF.c
ConvertUTF.h Ensure include guard is the first non-comment line 2017-11-14 23:21:28 +03:00
crypto-utils-cyassl.c
crypto-utils-fallback.c
crypto-utils-openssl.c
crypto-utils-polarssl.c
crypto-utils.c
crypto-utils.h
crypto.c
crypto.h
error-types.h
error.c
error.h
fdlimit.c
fdlimit.h
file-posix.c
file-win32.c
file.c
file.h
handshake.c
handshake.h
history.c
history.h
inout.c
inout.h
jsonsl.c
jsonsl.h
libt.dox
list.c
list.h Update to Uncrustify 0.68.1 2019-02-15 09:21:48 +03:00
log.c
log.h
magnet.c
magnet.h
makemeta.c
makemeta.h
metainfo.c
metainfo.h
mime-types.c
mime-types.h
mime-types.js
natpmp.c
natpmp_local.h
net.c
net.h
peer-common.h Ensure include guard is the first non-comment line 2017-11-14 23:21:28 +03:00
peer-io.c
peer-io.h
peer-mgr.c
peer-mgr.h refactor: fix more sonarcloud warnings (#1508) 2020-11-05 16:46:21 -06:00
peer-msgs.c
peer-msgs.h
peer-socket.h
platform-quota.c
platform-quota.h
platform.c
platform.h
port-forwarding.c
port-forwarding.h
ptrarray.c
ptrarray.h
quark.c
quark.h
resume.c
resume.h
rpc-server.c
rpc-server.h
rpcimpl.c
rpcimpl.h
session-id.c
session-id.h
session.c
session.h
stats.c
stats.h
subprocess-posix.c
subprocess-win32.c
subprocess.h
torrent-ctor.c
torrent-magnet.c
torrent-magnet.h
torrent.c
torrent.h Sonarcloud warnings 4 (#1499) 2020-11-02 09:16:12 -06:00
tr-assert.c
tr-assert.h
tr-dht.c
tr-dht.h
tr-getopt.c
tr-getopt.h
tr-lpd.c
tr-lpd.h
tr-macros.h
tr-udp.c refactor: fix more sonarcloud warnings (#1508) 2020-11-05 16:46:21 -06:00
tr-udp.h
tr-utp.c
tr-utp.h
transmission.h
trevent.c
trevent.h
upnp.c
upnp.h
utils.c
utils.h
variant-benc.c
variant-common.h
variant-json.c
variant.c
variant.h
verify.c
verify.h Ensure include guard is the first non-comment line 2017-11-14 23:21:28 +03:00
version.h.in
watchdir-common.h
watchdir-generic.c
watchdir-inotify.c
watchdir-kqueue.c
watchdir-win32.c
watchdir.c
watchdir.h
web.c
web.h
webseed.c
webseed.h
wildmat.c