]> err.no Git - linux-2.6/blobdiff - net/ipv4/udplite.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[linux-2.6] / net / ipv4 / udplite.c
index 8d42e344b043b60000d9c869f2089b92f7f703ca..72ce26b6c4d337b10533b95db0577a9c184cede3 100644 (file)
@@ -31,10 +31,9 @@ static       struct net_protocol udplite_protocol = {
        .handler        = udplite_rcv,
        .err_handler    = udplite_err,
        .no_policy      = 1,
+       .netns_ok       = 1,
 };
 
-DEFINE_PROTO_INUSE(udplite)
-
 struct proto   udplite_prot = {
        .name              = "UDP-Lite",
        .owner             = THIS_MODULE,
@@ -59,7 +58,6 @@ struct proto  udplite_prot = {
        .compat_setsockopt = compat_udp_setsockopt,
        .compat_getsockopt = compat_udp_getsockopt,
 #endif
-       REF_PROTO_INUSE(udplite)
 };
 
 static struct inet_protosw udplite4_protosw = {
@@ -73,15 +71,42 @@ static struct inet_protosw udplite4_protosw = {
 };
 
 #ifdef CONFIG_PROC_FS
-static struct file_operations udplite4_seq_fops;
 static struct udp_seq_afinfo udplite4_seq_afinfo = {
-       .owner          = THIS_MODULE,
        .name           = "udplite",
        .family         = AF_INET,
        .hashtable      = udplite_hash,
-       .seq_show       = udp4_seq_show,
-       .seq_fops       = &udplite4_seq_fops,
+       .seq_fops       = {
+               .owner  =       THIS_MODULE,
+       },
+       .seq_ops        = {
+               .show           = udp4_seq_show,
+       },
+};
+
+static int udplite4_proc_init_net(struct net *net)
+{
+       return udp_proc_register(net, &udplite4_seq_afinfo);
+}
+
+static void udplite4_proc_exit_net(struct net *net)
+{
+       udp_proc_unregister(net, &udplite4_seq_afinfo);
+}
+
+static struct pernet_operations udplite4_net_ops = {
+       .init = udplite4_proc_init_net,
+       .exit = udplite4_proc_exit_net,
 };
+
+static __init int udplite4_proc_init(void)
+{
+       return register_pernet_subsys(&udplite4_net_ops);
+}
+#else
+static inline int udplite4_proc_init(void)
+{
+       return 0;
+}
 #endif
 
 void __init udplite4_register(void)
@@ -94,10 +119,8 @@ void __init udplite4_register(void)
 
        inet_register_protosw(&udplite4_protosw);
 
-#ifdef CONFIG_PROC_FS
-       if (udp_proc_register(&init_net, &udplite4_seq_afinfo))
+       if (udplite4_proc_init())
                printk(KERN_ERR "%s: Cannot register /proc!\n", __func__);
-#endif
        return;
 
 out_unregister_proto: