Skip to content

gen_init_cpio: add copy_file_range / reflink support

David Disseldorp linux-fsdevel linux-kbuild linux-next oe-kbuild-all 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 5 repliesApplied
  2. v27 patches 9 repliesSuperseded
  3. v1 RFC5 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- add Nicolas' Reviewed-by tag to patches 1-7
- add patch 8 test for extracting a cpio archive with filename padding
- use trailing '||' for multi-line if conditions instead of prefix
- refer to -o output_file in usage instead of output_path
- define _GNU_SOURCE alongside O_LARGEFILE use, instead of later

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/8gen_init_cpio: write to fd instead of stdout streamusr/gen_init_cpio.c+81 -580 replies
2/8gen_init_cpio: support -o <output_file> parameterusr/gen_init_cpio.c+16 -40 replies
3/8gen_init_cpio: attempt copy_file_range for file datausr/gen_init_cpio.c+12 -10 replies
4/8gen_init_cpio: avoid duplicate strlen callsusr/gen_init_cpio.c+24 -160 replies
5/8gen_initramfs.sh: use gen_init_cpio -o parameterusr/gen_initramfs.sh+4 -30 replies
6/8docs: initramfs: file data alignment via name paddingDocumentation/driver-api/early-userspace/buffer-format.rst+5 -00 replies
7/8gen_init_cpio: add -a <data_align> as reflink optimizationusr/gen_init_cpio.c+38 -110 replies
8/8initramfs_test: add filename padding test caseinit/initramfs_test.c+67 -14 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchNicolas Schier
1/8R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/8] gen_init_cpio: add copy_file_range / reflink support

This patchset adds copy_file_range() support to gen_init_cpio. When combined with data segment alignment, large-file archiving performance is improved on Btrfs and XFS due to reflinks (see patch 7 benchmarks).

cpio data segment alignment is provided by "bending" the newc spec to zero-pad the filename field. GNU cpio and Linux initramfs extractors handle this fine as long as PATH_MAX isn't exceeded. A kernel initramfs extraction unit test for this is provided.

Changes since v2
- add Nicolas' Reviewed-by tag to patches 1-7
- add patch 8 test for extracting a cpio archive with filename padding
- use trailing '||' for multi-line if conditions instead of prefix
- refer to -o output_file in usage instead of output_path
- define _GNU_SOURCE alongside O_LARGEFILE use, instead of later

Changes since v1 RFC
- add alignment patches 6-7
- slightly rework commit and error messages
- rename l->len to avoid 1/i confusion