Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSystem.Unix: improve CopyFile. #59695

Merged
merged 9 commits into from
Nov 15, 2021
Merged

Commits on Oct 19, 2021

  1. FileSystem.Unix: improve CopyFile.

    Like the upcoming version of GNU coreutils 'cp' prefer a copy-on-write clone.
    This shares the physical storage between files, which means no data needs to copied.
    CoW-clones are supported by a number of Linux file systems, like Btrfs, XFS, and overlayfs.
    
    Eliminate a 'stat' call that is always performed for checking if the target is a directory
    by only performing the check when the 'open' syscall reports an error.
    
    Eliminate a 'stat' call for retrieving the file size of the source by passing through
    the length that was retrieved when checking the opened file is not a directory.
    
    Create the destination with file permissions that match the source.
    We still need to fchmod due to umask being applied to the open mode.
    
    When performing a manual copy, limit the allocated buffer for small files.
    And, avoid the last 'read' call by checking when we've copied the expected nr of bytes.
    tmds committed Oct 19, 2021
    Configuration menu
    Copy the full SHA
    e2d3577 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2021

  1. Configuration menu
    Copy the full SHA
    712db40 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2021

  1. PR feedback

    tmds committed Oct 26, 2021
    Configuration menu
    Copy the full SHA
    3fd621d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b7ab817 View commit details
    Browse the repository at this point in the history
  3. Fall through when FICLONE fails.

    tmds committed Oct 26, 2021
    Configuration menu
    Copy the full SHA
    9be3b2f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4e70e52 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2021

  1. Configuration menu
    Copy the full SHA
    3c95290 View commit details
    Browse the repository at this point in the history
  2. Move comment a few lines up.

    tmds committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    5d7cd45 View commit details
    Browse the repository at this point in the history
  3. Fix unused error.

    tmds committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    b67b262 View commit details
    Browse the repository at this point in the history