summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-10-30 08:06:56 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-10-30 08:06:56 +0000
commit3b82cf0e189ea1bca1a8cacba6334684e106abd9 (patch)
tree6a172e4ddea97e47761efdef13031cb93de9fa60
parent981c40271130fc5b13299c002b1ef7569f957584 (diff)
downloadsrc-test2-3b82cf0e189ea1bca1a8cacba6334684e106abd9.tar.gz
src-test2-3b82cf0e189ea1bca1a8cacba6334684e106abd9.zip
MFC r366961:
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 <meka@tilda.center> Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/stable/11/; revision=367158
-rw-r--r--sys/fs/cuse/cuse.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/fs/cuse/cuse.c b/sys/fs/cuse/cuse.c
index 65ca2bda8259..8f30b0fac54d 100644
--- a/sys/fs/cuse/cuse.c
+++ b/sys/fs/cuse/cuse.c
@@ -66,6 +66,24 @@
#include <fs/cuse/cuse_defs.h>
#include <fs/cuse/cuse_ioctl.h>
+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);
/*