This series adds an opt-in archive layout that is suitable for extent sharing, together with an extraction fast path that can take advantage of that layout.
Patch 1 adds --align=SIZE for POSIX archive creation, append, and update. It pads an ignorable GNU.pad PAX record so sufficiently large regular-file payloads begin at the requested boundary in the uncompressed archive stream. Existing readers continue to see an ordinary POSIX archive and ignore the padding record. Alignment is disabled by default and is preserved when the stream is subsequently compressed and decompressed. Patch 2 copies contiguous regular-file payloads directly from a local, uncompressed archive with copy_file_range(). It uses explicit source offsets so tar's read-ahead state remains intact and falls back to buffered I/O before any bytes are copied when the syscall or filesystem cannot handle the operation. Compressed, remote, multi-volume, sparse, pipe, and checkpoint cases remain on the existing buffered path. Standard output is eligible when it is redirected to a regular file. Together these changes allow a suitably aligned archive on a filesystem with extent-sharing copy_file_range() support to share member data with extracted files, avoiding userspace copies and potentially avoiding duplicate storage. Daan De Meyer (2): tar: add alignment option for regular file data tar: accelerate extraction with copy_file_range NEWS | 15 ++++++ doc/tar.texi | 33 ++++++++++++++ gnulib.modules | 1 + src/buffer.c | 71 +++++++++++++++++++++++++++++ src/common.h | 14 ++++++ src/create.c | 20 +++++++- src/extract.c | 27 ++++++++++- src/tar.c | 36 ++++++++++++++- src/update.c | 7 +++ src/xheader.c | 69 ++++++++++++++++++++++++++++ tests/Makefile.am | 2 + tests/align.at | 111 +++++++++++++++++++++++++++++++++++++++++++++ tests/extrac35.at | 71 +++++++++++++++++++++++++++++ tests/testsuite.at | 2 + 14 files changed, 475 insertions(+), 4 deletions(-) create mode 100644 tests/align.at create mode 100644 tests/extrac35.at -- 2.54.0
