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

Fix nativeimgutil.ConvertToRaw() #2718

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Commits on Oct 14, 2024

  1. Fix nativeimgutil.ConvertToRaw()

    - Truncate before copying the data to eliminate the seeks during the
      copy. This also provides a hint to the file system that can minimize
      allocations and fragmentation of the file.
    
    - Avoid unneeded seeks during copy using WriteAt. This does not improve
      performance since practically all time is spent on reading from the
      source image.
    
    - Fix zero detection to handle short reads. Previously we would compare
      the entire buffer which can contain non-zero bytes from the previous
      read.
    
    - Fix write to handle short reads. Previously we would write the entire
      buffer including data from previous read, corrupting the image.
    
    - Fix error message for failed write. Looks like it was copied from the
      read branch.
    
    Signed-off-by: Nir Soffer <[email protected]>
    nirs committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    4a24c29 View commit details
    Browse the repository at this point in the history