RFR: 6980847: (fs) Files.copy needs to be tuned [v5]
Brian Burkhalter
bpb at openjdk.org
Wed Jun 22 01:15:22 UTC 2022
On Fri, 17 Jun 2022 11:57:37 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 6980847: Use temporary direct buffer for user-space copy
>
> src/java.base/unix/classes/sun/nio/fs/UnixCopyFile.java line 297:
>
>> 295: } catch (IllegalArgumentException | UnixException ignored) {
>> 296: }
>> 297: transferSize = ts;
>
> This code needs to move to a separate method, something like transferSize(source, target).
Fixed.
> src/java.base/windows/classes/sun/nio/fs/WindowsFileCopy.java line 186:
>
>> 184: }
>> 185: final int flags = ((!followLinks) ? COPY_FILE_COPY_SYMLINK : 0) |
>> 186: ((size > UNBUFFERED_IO_THRESHOLD) ? COPY_FILE_NO_BUFFERING : 0);
>
> The size of the source file is already in sourceAttrs.size(), no need to call back into the API to access the file again.
Fixed.
-------------
PR: https://git.openjdk.org/jdk/pull/9161
More information about the nio-dev
mailing list