MCPcopy Create free account
hub / github.com/F-Stack/f-stack / linker_release_module

Function linker_release_module

freebsd/kern/kern_linker.c:526–549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526int
527linker_release_module(const char *modname, struct mod_depend *verinfo,
528 linker_file_t lf)
529{
530 modlist_t mod;
531 int error;
532
533 sx_xlock(&kld_sx);
534 if (lf == NULL) {
535 KASSERT(modname != NULL,
536 ("linker_release_module: no file or name"));
537 mod = modlist_lookup2(modname, verinfo);
538 if (mod == NULL) {
539 sx_xunlock(&kld_sx);
540 return (ESRCH);
541 }
542 lf = mod->container;
543 } else
544 KASSERT(modname == NULL && verinfo == NULL,
545 ("linker_release_module: both file and name"));
546 error = linker_file_unload(lf, LINKER_UNLOAD_NORMAL);
547 sx_xunlock(&kld_sx);
548 return (error);
549}
550
551static linker_file_t
552linker_find_file_by_name(const char *filename)

Callers 2

loadimageFunction · 0.85
unloadentryFunction · 0.85

Calls 2

modlist_lookup2Function · 0.85
linker_file_unloadFunction · 0.85

Tested by

no test coverage detected