[Drbd-dev] [Patch v1 8/8] Statically initialize families

Nick Wang nwang at suse.com
Mon Mar 13 08:23:31 CET 2017


In a07ea4d9, genetlink no longer use static family id.
GENL_ID_GENERATE is removed.
In 489111e5, statically initialize the families and remove
the inline functions.

Signed-off-by: Nick Wang <nwang at suse.com>
CC: Lars Ellenberg <lars.ellenberg at linbit.com>
CC: Roland Kammerer <roland.kammerer at linbit.com>
CC: drbd-dev at lists.linbit.com 
---
 linux/genl_magic_func.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/linux/genl_magic_func.h b/linux/genl_magic_func.h
index d14a557..ae9b9de 100644
--- a/linux/genl_magic_func.h
+++ b/linux/genl_magic_func.h
@@ -251,7 +251,9 @@ static struct genl_ops ZZZ_genl_ops[] __read_mostly = {
  */
 #define ZZZ_genl_family		CONCAT_(GENL_MAGIC_FAMILY, _genl_family)
 static struct genl_family ZZZ_genl_family __read_mostly = {
+#ifdef HAVE_GENL_ID_GENERATE
 	.id = GENL_ID_GENERATE,
+#endif
 	.name = __stringify(GENL_MAGIC_FAMILY),
 	.version = GENL_MAGIC_VERSION,
 #ifdef GENL_MAGIC_FAMILY_HDRSZ
@@ -275,7 +277,8 @@ static struct genl_family ZZZ_genl_family __read_mostly = {
  * genetlink: only pass array to genl_register_family_with_ops()
  * which are commits c53ed742..2a94fe48
  */
-#ifdef genl_register_family_with_ops_groups
+#if defined(genl_register_family_with_ops_groups) || \
+    defined(COMPAT_HAVE_GENL_FAMILY_IN_GENLMSG_MULTICAST)
 #include <linux/genl_magic_func-genl_register_family_with_ops_groups.h>
 #else
 #include <linux/genl_magic_func-genl_register_mc_group.h>
-- 
1.8.5.6



More information about the drbd-dev mailing list