From: glass.saga@... Date: 2017-10-21T06:31:22+00:00 Subject: [ruby-core:83430] [Ruby trunk Feature#13867][Assigned] Copy offloading in IO.copy_stream Issue #13867 has been updated by Glass_saga (Masaki Matsushita). File patch2.diff added Status changed from Open to Assigned Assignee set to Glass_saga (Masaki Matsushita) This patch makes IO.copy_stream use copy_file_range(2) without keyword arguments. ---------------------------------------- Feature #13867: Copy offloading in IO.copy_stream https://bugs.ruby-lang.org/issues/13867#change-67396 * Author: Glass_saga (Masaki Matsushita) * Status: Assigned * Priority: Normal * Assignee: Glass_saga (Masaki Matsushita) * Target version: 2.5 ---------------------------------------- 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. ```ruby 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) patch2.diff (3.35 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: