| 2284 | } |
| 2285 | |
| 2286 | static int |
| 2287 | carp_modevent(module_t mod, int type, void *data) |
| 2288 | { |
| 2289 | switch (type) { |
| 2290 | case MOD_LOAD: |
| 2291 | return carp_mod_load(); |
| 2292 | /* NOTREACHED */ |
| 2293 | case MOD_UNLOAD: |
| 2294 | mtx_lock(&carp_mtx); |
| 2295 | if (LIST_EMPTY(&carp_list)) |
| 2296 | carp_mod_cleanup(); |
| 2297 | else { |
| 2298 | mtx_unlock(&carp_mtx); |
| 2299 | return (EBUSY); |
| 2300 | } |
| 2301 | break; |
| 2302 | |
| 2303 | default: |
| 2304 | return (EINVAL); |
| 2305 | } |
| 2306 | |
| 2307 | return (0); |
| 2308 | } |
| 2309 | |
| 2310 | static moduledata_t carp_mod = { |
| 2311 | "carp", |
nothing calls this directly
no test coverage detected