Patchwork [RFC,6/8] l2tp: export additional genetlink APIs

login
register
mail settings
Submitter James Chapman
Date Feb. 22, 2009, 5:52 p.m.
Message ID <200902221752.n1MHqKa4006549@bert.katalix.com>
Download mbox | patch
Permalink /patch/23540/
State RFC
Delegated to: David Miller
Headers show

Comments

James Chapman - Feb. 22, 2009, 5:52 p.m.
Export genl_lock API for use by modules.

This lets kernel modules which use genl netlink APIs serialize netlink
processing.

Signed-off-by: James Chapman <jchapman@katalix.com>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Index: net-next-2.6-l2tpv3-2/include/linux/genetlink.h
===================================================================
--- net-next-2.6-l2tpv3-2.orig/include/linux/genetlink.h
+++ net-next-2.6-l2tpv3-2/include/linux/genetlink.h
@@ -80,4 +80,12 @@  enum {
 
 #define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
 
+#ifdef __KERNEL__
+
+/* All generic netlink requests are serialized by a global lock.  */
+extern void genl_lock(void);
+extern void genl_unlock(void);
+
+#endif /* __KERNEL__ */
+
 #endif	/* __LINUX_GENERIC_NETLINK_H */
Index: net-next-2.6-l2tpv3-2/net/netlink/genetlink.c
===================================================================
--- net-next-2.6-l2tpv3-2.orig/net/netlink/genetlink.c
+++ net-next-2.6-l2tpv3-2/net/netlink/genetlink.c
@@ -22,15 +22,17 @@  struct sock *genl_sock = NULL;
 
 static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
 
-static inline void genl_lock(void)
+void genl_lock(void)
 {
 	mutex_lock(&genl_mutex);
 }
+EXPORT_SYMBOL(genl_lock);
 
-static inline void genl_unlock(void)
+void genl_unlock(void)
 {
 	mutex_unlock(&genl_mutex);
 }
+EXPORT_SYMBOL(genl_unlock);
 
 #define GENL_FAM_TAB_SIZE	16
 #define GENL_FAM_TAB_MASK	(GENL_FAM_TAB_SIZE - 1)