* This is the function that is called to load and unload the module. * When the module is loaded, this function is called once with * "what" == MOD_LOAD * When the module is unloaded, this function is called twice with * "what" = MOD_QUIESCE first, followed by "what" = MOD_UNLOAD second * When the system is shut down e.g. CTRL-ALT-DEL or using the shutdown command, * this function is called
| 1553 | * of the shutdown sequence i.e. after the disks have been synced. |
| 1554 | */ |
| 1555 | static int |
| 1556 | siftr_load_handler(module_t mod, int what, void *arg) |
| 1557 | { |
| 1558 | int ret; |
| 1559 | |
| 1560 | switch (what) { |
| 1561 | case MOD_LOAD: |
| 1562 | ret = init_siftr(); |
| 1563 | break; |
| 1564 | |
| 1565 | case MOD_QUIESCE: |
| 1566 | case MOD_SHUTDOWN: |
| 1567 | ret = deinit_siftr(); |
| 1568 | break; |
| 1569 | |
| 1570 | case MOD_UNLOAD: |
| 1571 | ret = 0; |
| 1572 | break; |
| 1573 | |
| 1574 | default: |
| 1575 | ret = EINVAL; |
| 1576 | break; |
| 1577 | } |
| 1578 | |
| 1579 | return (ret); |
| 1580 | } |
| 1581 | |
| 1582 | static moduledata_t siftr_mod = { |
| 1583 | .name = "siftr", |
nothing calls this directly
no test coverage detected