| 524 | } |
| 525 | |
| 526 | int |
| 527 | linker_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 | |
| 551 | static linker_file_t |
| 552 | linker_find_file_by_name(const char *filename) |
no test coverage detected