1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-19 05:19:54 +00:00
transmission/tests/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
..
.clang-tidy silence readability-function-cognitive-complexity (#1703) 2021-05-20 15:00:20 -05:00
bitfield-test.cc
blocklist-test.cc
clients-test.cc Retain full BitLord build number 2021-04-27 20:47:37 -07:00
CMakeLists.txt Add in-kernel file copying for several platforms. (#1092) 2021-08-07 12:04:03 +03:00
copy-test.cc Add in-kernel file copying for several platforms. (#1092) 2021-08-07 12:04:03 +03:00
crypto-test-ref.h
crypto-test.cc refactor: work around msvc constxpr std::array bug (#1429) 2020-09-07 19:33:36 -05:00
error-test.cc
file-test.cc
getopt-test.cc refactor: work around msvc constxpr std::array bug (#1429) 2020-09-07 19:33:36 -05:00
history-test.cc
json-test.cc
magnet-test.cc refactor: work around msvc constxpr std::array bug (#1429) 2020-09-07 19:33:36 -05:00
makemeta-test.cc
metainfo-test.cc refactor: work around msvc constxpr std::array bug (#1429) 2020-09-07 19:33:36 -05:00
move-test.cc
peer-msgs-test.cc
quark-test.cc
rename-test.cc refactor: work around msvc constxpr std::array bug (#1429) 2020-09-07 19:33:36 -05:00
rpc-test.cc configure anti brute force (#1447) 2020-11-14 12:43:42 -06:00
session-test.cc
subprocess-test.cc Increase file wait timeout to 30s in subprocess test 2020-10-15 01:27:52 +03:00
subprocess-test.cmd
test-fixtures.h
utils-test.cc feat: add torrent-get 'primary-mime-type' to RPC. (#1464) 2020-10-13 10:33:56 -05:00
variant-test.cc chore: add precommit hook for testing code style (#1448) 2020-09-13 21:41:32 -05:00
watchdir-test.cc