Project

General

Profile

Feature #13866

Copy offloading in IO.copy_stream

Added by Glass_saga (Masaki Matsushita) almost 3 years ago. Updated almost 3 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
[ruby-dev:50226]

Description

In linux 4.5, the copy offloading feature with copy_file_range(2) was introduced.
This patch enables IO.copy_stream to use it.
If "offload" keyword argument is specified, IO.copy_stream will try copy offloading.

IO.copy_stream("src", "dst", offload: true)

If copy offloading is not available on the system, "offload" option will be ignored.

When "src" and "dst" are not in the same filesystem, copy_file_range(2) must fail with EXDEV.
In this case, IO.copy_steram will fallback to another method (sendfile(2) or read/write) silently.

It depends on the filesystem what offloading techniques will be used.
Copy offloading is optional in IO.copy_stream because some techniques may change the current behavior.


Files

patch.diff (7.21 KB) patch.diff Glass_saga (Masaki Matsushita), 09/05/2017 08:55 AM

Updated by Glass_saga (Masaki Matsushita) almost 3 years ago

  • Status changed from Open to Rejected

間違えてruby-devに投げてしまったので、rejectします。

Also available in: Atom PDF