]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gen_init_cpio: attempt copy_file_range for file data
authorDavid Disseldorp <ddiss@suse.de>
Tue, 19 Aug 2025 03:05:46 +0000 (13:05 +1000)
committerNathan Chancellor <nathan@kernel.org>
Wed, 20 Aug 2025 23:02:55 +0000 (16:02 -0700)
commit97169cd6d95b338f2dbf5d3154b7d2233fce7d8a
treefe4c7b350c929d4148dd5a07cb10674b2a210732
parentae18b94099b04264b32e33b057114024bc72c993
gen_init_cpio: attempt copy_file_range for file data

The copy_file_range syscall can improve copy performance by cloning
extents between cpio archive source and destination files.
Existing read / write based copy logic is retained for fallback in case
the copy_file_range syscall is unsupported or unavailable due to
cross-filesystem EXDEV, etc.

Clone or reflink, as opposed to copy, of source file extents into the
output cpio archive may (e.g. on Btrfs and XFS) require alignment of the
output to the filesystem block size. This could be achieved by inserting
padding entries into the cpio archive manifest.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://lore.kernel.org/r/20250819032607.28727-4-ddiss@suse.de
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
usr/gen_init_cpio.c