]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Make license compatibility checks consistent
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 29 Sep 2014 20:01:22 +0000 (16:01 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 17 Oct 2014 22:07:28 +0000 (15:07 -0700)
Apply the license specified in the META file to ensure the
compatibility checks are all performed consistently.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
META
config/spl-build.m4
config/spl-meta.m4
include/sys/mutex.h
module/spl/spl-generic.c
module/splat/splat-ctl.c

diff --git a/META b/META
index 117c3e336caee169c1f98e4675051aaa85b21b35..13d0d028aef042043a71a6775905a4a084c546d3 100644 (file)
--- a/META
+++ b/META
@@ -4,3 +4,5 @@ Branch:       1.0
 Version:      0.6.3
 Release:      1
 Release-Tags: relext
+License:      GPL
+Author:       OpenZFS on Linux
index 4b821e9808e2de688c8e9bda3dbcc29dc1c5b21f..f9287e2de1084c00ebd720a4c86162cbe73c106f 100644 (file)
@@ -426,11 +426,11 @@ AC_DEFUN([SPL_AC_PACKAGE], [
 ])
 
 AC_DEFUN([SPL_AC_LICENSE], [
+       AC_MSG_CHECKING([spl author])
+       AC_MSG_RESULT([$SPL_META_AUTHOR])
+
        AC_MSG_CHECKING([spl license])
-       LICENSE=GPL
-       AC_MSG_RESULT([$LICENSE])
-       KERNELCPPFLAGS="${KERNELCPPFLAGS} -DHAVE_GPL_ONLY_SYMBOLS"
-       AC_SUBST(LICENSE)
+       AC_MSG_RESULT([$SPL_META_LICENSE])
 ])
 
 AC_DEFUN([SPL_AC_CONFIG], [
@@ -737,7 +737,8 @@ AC_DEFUN([SPL_CHECK_HEADER],
 ])
 
 dnl #
-dnl # Basic toolchain sanity check.
+dnl # Basic toolchain sanity check.  Verify that kernel modules can
+dnl # be built and which symbols can be used.
 dnl #
 AC_DEFUN([SPL_AC_TEST_MODULE],
        [AC_MSG_CHECKING([whether modules can be built])
@@ -753,6 +754,18 @@ AC_DEFUN([SPL_AC_TEST_MODULE],
        *** Please run 'make scripts' inside the kernel source tree.])
                fi
        ])
+
+       AC_RUN_IFELSE([
+               AC_LANG_PROGRAM([
+                       #include "$LINUX/include/linux/license.h"
+               ], [
+                       return !license_is_gpl_compatible("$SPL_META_LICENSE");
+               ])
+       ], [
+               AC_DEFINE([SPL_IS_GPL_COMPATIBLE], [1],
+                   [Define to 1 if GPL-only symbols can be used])
+       ], [
+       ])
 ])
 
 dnl #
index e98cc2ea6378d5b247821d691f4faf1c3017264c..0561fbbc580ec2d23b6e9076ea105cc2630e0676 100644 (file)
@@ -76,6 +76,14 @@ AC_DEFUN([SPL_AC_META], [
                        AC_SUBST([RELEASE])
                fi
 
+               SPL_META_LICENSE=_SPL_AC_META_GETVAL([License]);
+               if test -n "$SPL_META_LICENSE"; then
+                       AC_DEFINE_UNQUOTED([SPL_META_LICENSE], ["$SPL_META_LICENSE"],
+                               [Define the project license.]
+                       )
+                       AC_SUBST([SPL_META_LICENSE])
+               fi
+
                if test -n "$SPL_META_NAME" -a -n "$SPL_META_VERSION"; then
                                SPL_META_ALIAS="$SPL_META_NAME-$SPL_META_VERSION"
                                test -n "$SPL_META_RELEASE" && 
index ec3cfd52914956a2606c381f1f590b59ea3f2196..cc63a6be0577526735dbab640bfa401bc96e986f 100644 (file)
@@ -85,12 +85,6 @@ mutex_owner(kmutex_t *mp)
  })
 #define mutex_exit(mp)                  mutex_unlock(&(mp)->m)
 
-#ifdef HAVE_GPL_ONLY_SYMBOLS
-# define mutex_enter_nested(mp, sc)     mutex_lock_nested(&(mp)->m, sc)
-#else
-# define mutex_enter_nested(mp, sc)     mutex_enter(mp)
-#endif /* HAVE_GPL_ONLY_SYMBOLS */
-
 #else /* HAVE_MUTEX_OWNER */
 
 typedef struct {
@@ -197,19 +191,6 @@ spl_mutex_clear_owner(kmutex_t *mp)
         mutex_unlock(MUTEX(mp));                                        \
 })
 
-#ifdef HAVE_GPL_ONLY_SYMBOLS
-# define mutex_enter_nested(mp, sc)                                     \
-({                                                                      \
-        mutex_lock_nested(MUTEX(mp), sc);                               \
-        spl_mutex_set_owner(mp);                                        \
-})
-#else
-# define mutex_enter_nested(mp, sc)                                     \
-({                                                                      \
-        mutex_enter(mp);                                                \
-})
-#endif
-
 #endif /* HAVE_MUTEX_OWNER */
 
 int spl_mutex_init(void);
index 194cd7df188d5ddb269bcebdcc5242420c3ca14a..039ee73198872a95e14f55b9cc2e6eadaaddfa81 100644 (file)
@@ -740,7 +740,7 @@ EXPORT_SYMBOL(spl_cleanup);
 module_init(spl_init);
 module_exit(spl_fini);
 
-MODULE_AUTHOR("Lawrence Livermore National Labs");
 MODULE_DESCRIPTION("Solaris Porting Layer");
-MODULE_LICENSE("GPL");
+MODULE_AUTHOR(SPL_META_AUTHOR);
+MODULE_LICENSE(SPL_META_LICENSE);
 MODULE_VERSION(SPL_META_VERSION "-" SPL_META_RELEASE);
index 6bbe0abba02703e17ba575f663160bf1246987f2..c4337a9f57d5cb53ff950fe247d0606c62dbe6a9 100644 (file)
@@ -718,7 +718,7 @@ splat_fini(void)
 spl_module_init(splat_init);
 spl_module_exit(splat_fini);
 
-MODULE_AUTHOR("Lawrence Livermore National Labs");
 MODULE_DESCRIPTION("Solaris Porting LAyer Tests");
-MODULE_LICENSE("GPL");
+MODULE_AUTHOR(SPL_META_AUTHOR);
+MODULE_LICENSE(SPL_META_LICENSE);
 MODULE_VERSION(SPL_META_VERSION "-" SPL_META_RELEASE);