RFR: 8264744: (fs) Use file cloning in Linux and macOS versions of FileChannel transfer and Files copy methods [v7]

Brian Burkhalter bpb at openjdk.org
Fri Aug 12 15:35:18 UTC 2022


On Fri, 12 Aug 2022 08:26:08 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
>> 
>>  - 8264744: Refactor {Bsd,Linux}CopyFile::clone into {Bsd,Linux}FileSystem::clone
>>  - Merge
>>  - 8264744: Remove CloneFile classes; refactor to use {Bsd,Linux}CopyFile
>>  - Merge
>>  - 8264744: Fix typo desintation -> destination
>>  - 8264744: Refactor into UnixCopyFile hierarchy
>>  - Merge
>>  - 8264744: Address review comments aside from refactoring
>>  - 8264744: Refactor into provider+dispatcher to reduce amount of JNI code
>>  - 8264744: (fc, fs) Support file cloning in Unix versions of FileChannel transfer and Files copy methods
>
> src/java.base/linux/native/libnio/fs/LinuxNativeDispatcher.c line 42:
> 
>> 40: 
>> 41: #ifndef FICLONE
>> 42: #define FICLONE      1074041865
> 
> Are we sure this value is the same on all architectures?

Testing succeeded on all platforms I've tried. It's been around since [Linux 4.5](https://man7.org/linux/man-pages/man2/ioctl_ficlone.2.html#VERSIONS) which was released [13 March 2016](https://en.wikipedia.org/wiki/Linux_kernel_version_history#Releases_4.x.y) and I verified that it has the same numerical value as `BTRFS_IOC_CLONE` which it supersedes.

-------------

PR: https://git.openjdk.org/jdk/pull/9486


More information about the nio-dev mailing list