HomeFreeBSD

loader: Add preload operation to fs_ops

Description

loader: Add preload operation to fs_ops

When we load an ELF file (kernel or module) we do seek(2) a lot to
parse/load the different sections of the ELF file.
Protocol like TFTP suffers a lot from this as there is no resume or
a way to start the tranfer from a specified offset in the file.
fs_preload is added to help those protocol.
Call preload just after opening the ELF file that we need to load so
the underlying method can cache the hole file and then read/lseek operations
are faster.

Reviewed by: imp
MFC after: 2 weeks
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D33409

(cherry picked from commit c25d9aff4607e7f1c378b0b7853e49c07c0af91a)

Details

Provenance
manuAuthored on Dec 10 2021, 9:33 AM
Reviewer
imp
Differential Revision
D33409: loader: Add preload operation to fs_ops
Parents
rGbc9154a20824: loader: implement mount/unmount rootfs
Branches
Unknown
Tags
Unknown