| 191 | } |
| 192 | |
| 193 | void |
| 194 | module_release(module_t mod) |
| 195 | { |
| 196 | |
| 197 | MOD_XLOCK_ASSERT; |
| 198 | |
| 199 | if (mod->refs <= 0) |
| 200 | panic("module_release: bad reference count"); |
| 201 | |
| 202 | MOD_DPF(REFS, ("module_release: before, refs=%d\n", mod->refs)); |
| 203 | |
| 204 | mod->refs--; |
| 205 | if (mod->refs == 0) { |
| 206 | TAILQ_REMOVE(&modules, mod, link); |
| 207 | if (mod->file) |
| 208 | TAILQ_REMOVE(&mod->file->modules, mod, flink); |
| 209 | free(mod, M_MODULE); |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | module_t |
| 214 | module_lookupbyname(const char *name) |
no test coverage detected