Page MenuHomeFreeBSD

pax: Use copy_file_range
Needs ReviewPublic

Authored by des on Jul 26 2026, 12:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 11, 9:28 AM
Unknown Object (File)
Tue, Sep 8, 5:13 AM
Unknown Object (File)
Sun, Sep 6, 12:45 PM
Unknown Object (File)
Sun, Sep 6, 6:58 AM
Unknown Object (File)
Sun, Sep 6, 3:45 AM
Unknown Object (File)
Sat, Sep 5, 10:44 AM
Unknown Object (File)
Fri, Sep 4, 12:12 PM
Unknown Object (File)
Fri, Sep 4, 4:25 AM
Subscribers

Details

Reviewers
None
Group Reviewers
Klara
Summary

Use copy_file_range(2) instead of our own inefficient and unreliable
attempt at detecting holes. If copy_file_range(2) is not available,
which in theory should be never, we fall back to a simple read(2) /
write(2) loop which makes no attempt to copy holes. This should
speed up pax copy mode and cpio passthrough mode significantly.

This includes refactoring much of the existing I/O code to use the
size_t and ssize_t instead of int where appropriate.

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75144
Build 72027: arc lint + arc unit