From a71074e0af2b37a3f9082bafb8a0a0feb3cd4515 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Fri, 23 Oct 2020 08:44:53 +0000 Subject: [PATCH] Fix for loading cuse.ko via rc.d . Make sure we declare the cuse(3) module by name and not only by the version information, so that "kldstat -q -m cuse" works. Found by: Goran Mekic MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking --- sys/fs/cuse/cuse.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c index ccb0a901e2d..a893250043c 100644 --- a/sys/fs/cuse/cuse.c +++ b/sys/fs/cuse/cuse.c @@ -64,6 +64,24 @@ #include #include +static int +cuse_modevent(module_t mod, int type, void *data) +{ + switch (type) { + case MOD_LOAD: + case MOD_UNLOAD: + return (0); + default: + return (EOPNOTSUPP); + } +} + +static moduledata_t cuse_mod = { + .name = "cuse", + .evhand = &cuse_modevent, +}; + +DECLARE_MODULE(cuse, cuse_mod, SI_SUB_DEVFS, SI_ORDER_FIRST); MODULE_VERSION(cuse, 1); /*