Wrap Linux module macros

MODULE_VERSION is already defined on FreeBSD. Wrap all of the
used MODULE_* macros for the sake of consistency and portability.

Add a user space noop version to reduce the need for _KERNEL ifdefs.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #9542
This commit is contained in:
Matthew Macy
2019-11-01 10:41:03 -07:00
committed by Brian Behlendorf
parent bd4dde8ef7
commit 4a2ed90013
13 changed files with 119 additions and 46 deletions
+5 -4
View File
@@ -46,6 +46,7 @@
#include <sys/strings.h>
#include <linux/kmod.h>
#include "zfs_gitrev.h"
#include <linux/mod_compat.h>
char spl_gitrev[64] = ZFS_META_GITREV;
@@ -751,7 +752,7 @@ spl_fini(void)
module_init(spl_init);
module_exit(spl_fini);
MODULE_DESCRIPTION("Solaris Porting Layer");
MODULE_AUTHOR(ZFS_META_AUTHOR);
MODULE_LICENSE("GPL");
MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
ZFS_MODULE_DESCRIPTION("Solaris Porting Layer");
ZFS_MODULE_AUTHOR(ZFS_META_AUTHOR);
ZFS_MODULE_LICENSE("GPL");
ZFS_MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
+5 -5
View File
@@ -318,9 +318,9 @@ _fini(void)
#if defined(_KERNEL)
module_init(_init);
module_exit(_fini);
MODULE_DESCRIPTION("ZFS");
MODULE_AUTHOR(ZFS_META_AUTHOR);
MODULE_LICENSE(ZFS_META_LICENSE);
MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
#endif
ZFS_MODULE_DESCRIPTION("ZFS");
ZFS_MODULE_AUTHOR(ZFS_META_AUTHOR);
ZFS_MODULE_LICENSE(ZFS_META_LICENSE);
ZFS_MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);