On Thu, Jun 15, 2023 at 10:00:41PM -0700, Lucas De Marchi wrote:
Add a separate function to load the file contents when it's needed. When it's not needed on the path of loading modules via finit_module(), there is no need to mmap the file. This will help support loading modules with the in-kernel compression support. This is done differently than the lazy initialization for kmod_file_get_elf() because on the contents case there is also the file->size to be updated. It would be a weird API to return the pointer and have the size changed as a side-effect. Signed-off-by: Lucas De Marchi <lucas.de.marchi@xxxxxxxxx> --- v2: change kmod_file_load_contents() to void since the return is actually checked on the file struct
pushed with this change. Lucas De Marchi