From 65a311fcb2f44fce7eb05160d3198cefed5c27f9 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Tue, 13 Jul 2004 19:36:59 +0000 Subject: Give kldunload a -f(orce) argument. Add a MOD_QUIESCE event for modules. This should return error (EBUSY) of the module is in use. MOD_UNLOAD should now only fail if it is impossible (as opposed to inconvenient) to unload the module. Valid reasons are memory references into the module which cannot be tracked down and eliminated. When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is not given, MOD_QUIESCE failing will also prevent the unload. For backwards compatibility, we treat EOPNOTSUPP from MOD_QUIESCE as success. Document that modules should return EOPNOTSUPP for unknown events. --- sys/dev/digi/digi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/digi') diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index 68081d5f346c..b08cd5892f0b 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -1042,7 +1042,7 @@ digi_loadmoduledata(struct digi_softc *sc) if (digi_mod->dm_version != DIGI_MOD_VERSION) { printf("digi_%s.ko: Invalid version %d (need %d)\n", sc->module, digi_mod->dm_version, DIGI_MOD_VERSION); - linker_file_unload(lf); + linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (EINVAL); } @@ -1064,7 +1064,7 @@ digi_loadmoduledata(struct digi_softc *sc) bcopy(digi_mod->dm_link.data, sc->link.data, sc->link.size); } - linker_file_unload(lf); + linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (0); } -- cgit v1.3