| 504 | } |
| 505 | |
| 506 | int |
| 507 | linker_reference_module(const char *modname, struct mod_depend *verinfo, |
| 508 | linker_file_t *result) |
| 509 | { |
| 510 | modlist_t mod; |
| 511 | int error; |
| 512 | |
| 513 | sx_xlock(&kld_sx); |
| 514 | if ((mod = modlist_lookup2(modname, verinfo)) != NULL) { |
| 515 | *result = mod->container; |
| 516 | (*result)->refs++; |
| 517 | sx_xunlock(&kld_sx); |
| 518 | return (0); |
| 519 | } |
| 520 | |
| 521 | error = linker_load_module(NULL, modname, NULL, verinfo, result); |
| 522 | sx_xunlock(&kld_sx); |
| 523 | return (error); |
| 524 | } |
| 525 | |
| 526 | int |
| 527 | linker_release_module(const char *modname, struct mod_depend *verinfo, |
no test coverage detected