Skip to content

[release/1.7] Blockfile: Enlighten blockfile copy on Darwin#9047

Merged
fuweid merged 1 commit intocontainerd:release/1.7from
dcantah:1.7-darwin-copyfile
Sep 1, 2023
Merged

[release/1.7] Blockfile: Enlighten blockfile copy on Darwin#9047
fuweid merged 1 commit intocontainerd:release/1.7from
dcantah:1.7-darwin-copyfile

Conversation

@dcantah
Copy link
Copy Markdown
Member

@dcantah dcantah commented Sep 1, 2023

(cherry picked from commit 13ff185)

Original Description

The Go stdlib does not seem to have an efficient os.File.ReadFrom routine for other platforms like it does on Linux with copy_file_range. For Darwin at least we can use clonefile in its place, otherwise if we have a sparse file we'd have a fun surprise with the io.Copy approach..

We should see if there's other platforms that we can enhance here. I've forgotten what's the right route on Windows.

The Go stdlib does not seem to have an efficient os.File.ReadFrom
routine for other platforms like it does on Linux with
copy_file_range. For Darwin at least we can use clonefile
in its place, otherwise if we have a sparse file we'd have
a fun surprise with the io.Copy approach..

We should see if there's other platforms that we can enhance here.
I've forgotten what's the right route on Windows.

Signed-off-by: Danny Canter <[email protected]>
(cherry picked from commit 13ff185)
Signed-off-by: Danny Canter <[email protected]>
Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fuweid fuweid merged commit b7ada5e into containerd:release/1.7 Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants