1 |
On Fri, 3 Mar 2017 18:18:50 -0800 |
2 |
Zac Medico <zmedico@g.o> wrote: |
3 |
|
4 |
> Perform in-kernel file copying when possible, and also support |
5 |
> reflinks and sparse files. If the optimized implementation |
6 |
> fails at runtime, gracefully fallback to a plain read/write |
7 |
> loop. |
8 |
> |
9 |
> Compile-time and run-time fallbacks are implemented, so that |
10 |
> any incompatiblities will be handled gracefully. For example, |
11 |
> if the code is compiled on a system that supports the |
12 |
> copy_file_range syscall, but at run-time an older kernel that |
13 |
> does not support this syscall is detected, it will be handled |
14 |
> gracefully. There are similar fallbacks for lack of lseek |
15 |
> SEEK_DATA and sendfile support. |
16 |
> |
17 |
> X-Gentoo-Bug: 607868 |
18 |
> X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=607868 |
19 |
> --- |
20 |
> [PATCH v3] Changes: |
21 |
> * Add function documentation comments |
22 |
> * Rename do_lseek function to do_lseek_data |
23 |
> * Fix do_lseek_data to handle sparse blocks at EOF, and |
24 |
> fix _reflink_linux_file_copy to call ftruncate |
25 |
> * Eliminate indirection in python copyfile function |
26 |
> * Cleaned up error variable handling |
27 |
> * Added lseek calls to ensure correct revovery from EINTR |
28 |
> * Added buf != NULL call before free(buf) |
29 |
> |
30 |
> pym/portage/tests/util/file_copy/__init__.py | 0 |
31 |
> pym/portage/tests/util/file_copy/__test__.py | 0 |
32 |
> pym/portage/tests/util/file_copy/test_copyfile.py | 71 ++++ |
33 |
> pym/portage/util/file_copy/__init__.py | 36 ++ |
34 |
> pym/portage/util/movefile.py | 4 +- |
35 |
> setup.py | 9 + |
36 |
> src/portage_util_file_copy_reflink_linux.c | 385 |
37 |
> ++++++++++++++++++++++ 7 files changed, 504 insertions(+), 1 |
38 |
> deletion(-) create mode 100644 |
39 |
|
40 |
|
41 |
I'd say go for it, merge. There's been no additional feedback or review |
42 |
|
43 |
|
44 |
-- |
45 |
Brian Dolbec <dolsen> |