]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/netlink/genetlink.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / net / netlink / genetlink.c
index 8c11ca4a2121692614ac43064c2718695d11bf6b..150579a21469d664563dfcee8bdef5d3f0e355e1 100644 (file)
@@ -22,22 +22,14 @@ struct sock *genl_sock = NULL;
 
 static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
 
-static void genl_lock(void)
+static inline void genl_lock(void)
 {
        mutex_lock(&genl_mutex);
 }
 
-static int genl_trylock(void)
-{
-       return !mutex_trylock(&genl_mutex);
-}
-
-static void genl_unlock(void)
+static inline void genl_unlock(void)
 {
        mutex_unlock(&genl_mutex);
-
-       if (genl_sock && genl_sock->sk_receive_queue.qlen)
-               genl_sock->sk_data_ready(genl_sock, 0);
 }
 
 #define GENL_FAM_TAB_SIZE      16
@@ -478,16 +470,11 @@ static int genl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
        return ops->doit(skb, &info);
 }
 
-static void genl_rcv(struct sock *sk, int len)
+static void genl_rcv(struct sk_buff *skb)
 {
-       unsigned int qlen = 0;
-
-       do {
-               if (genl_trylock())
-                       return;
-               netlink_run_queue(sk, &qlen, genl_rcv_msg);
-               genl_unlock();
-       } while (qlen && genl_sock && genl_sock->sk_receive_queue.qlen);
+       genl_lock();
+       netlink_rcv_skb(skb, &genl_rcv_msg);
+       genl_unlock();
 }
 
 /**************************************************************************
@@ -782,8 +769,8 @@ static int __init genl_init(void)
        netlink_set_nonroot(NETLINK_GENERIC, NL_NONROOT_RECV);
 
        /* we'll bump the group number right afterwards */
-       genl_sock = netlink_kernel_create(NETLINK_GENERIC, 0, genl_rcv,
-                                         NULL, THIS_MODULE);
+       genl_sock = netlink_kernel_create(&init_net, NETLINK_GENERIC, 0,
+                                         genl_rcv, NULL, THIS_MODULE);
        if (genl_sock == NULL)
                panic("GENL: Cannot initialize generic netlink\n");