diff options
-rw-r--r-- | include/os/freebsd/spl/sys/mod_os.h | 7 | ||||
-rw-r--r-- | include/os/linux/kernel/linux/mod_compat.h | 2 | ||||
-rw-r--r-- | module/zcommon/zfs_prop.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/include/os/freebsd/spl/sys/mod_os.h b/include/os/freebsd/spl/sys/mod_os.h index ec1da1a46..9b1bdfbff 100644 --- a/include/os/freebsd/spl/sys/mod_os.h +++ b/include/os/freebsd/spl/sys/mod_os.h @@ -93,6 +93,13 @@ wrap_ ## fn(void *dummy __unused) \ } \ SYSINIT(zfs_ ## fn, SI_SUB_LAST, SI_ORDER_FIRST, wrap_ ## fn, NULL) +#define module_init_early(fn) \ +static void \ +wrap_ ## fn(void *dummy __unused) \ +{ \ + fn(); \ +} \ +SYSINIT(zfs_ ## fn, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST, wrap_ ## fn, NULL) #define module_exit(fn) \ static void \ diff --git a/include/os/linux/kernel/linux/mod_compat.h b/include/os/linux/kernel/linux/mod_compat.h index 1bd8206bb..62905240b 100644 --- a/include/os/linux/kernel/linux/mod_compat.h +++ b/include/os/linux/kernel/linux/mod_compat.h @@ -151,4 +151,6 @@ enum scope_prefix_types { #define ZFS_MODULE_LICENSE(s) MODULE_LICENSE(s) #define ZFS_MODULE_VERSION(s) MODULE_VERSION(s) +#define module_init_early(fn) module_init(fn) + #endif /* _MOD_COMPAT_H */ diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index 89ddc59b2..b78331187 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -1016,7 +1016,7 @@ zcommon_fini(void) kfpu_fini(); } -module_init(zcommon_init); +module_init_early(zcommon_init); module_exit(zcommon_fini); #endif |