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
+6 -6
View File
@@ -103,6 +103,7 @@
#include <sys/debug.h>
#include <sys/avl.h>
#include <sys/cmn_err.h>
#include <sys/mod.h>
/*
* Small arrays to translate between balance (or diff) values and child indices.
@@ -993,7 +994,6 @@ done:
}
#if defined(_KERNEL)
#include <linux/module.h>
static int __init
avl_init(void)
@@ -1008,11 +1008,12 @@ avl_fini(void)
module_init(avl_init);
module_exit(avl_fini);
#endif
MODULE_DESCRIPTION("Generic AVL tree implementation");
MODULE_AUTHOR(ZFS_META_AUTHOR);
MODULE_LICENSE(ZFS_META_LICENSE);
MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
ZFS_MODULE_DESCRIPTION("Generic AVL tree implementation");
ZFS_MODULE_AUTHOR(ZFS_META_AUTHOR);
ZFS_MODULE_LICENSE(ZFS_META_LICENSE);
ZFS_MODULE_VERSION(ZFS_META_VERSION "-" ZFS_META_RELEASE);
EXPORT_SYMBOL(avl_create);
EXPORT_SYMBOL(avl_find);
@@ -1029,4 +1030,3 @@ EXPORT_SYMBOL(avl_remove);
EXPORT_SYMBOL(avl_numnodes);
EXPORT_SYMBOL(avl_destroy_nodes);
EXPORT_SYMBOL(avl_destroy);
#endif