]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[UNIX]: Extend unix_sysctl_(un)register prototypes
authorPavel Emelyanov <xemul@openvz.org>
Sat, 1 Dec 2007 12:40:40 +0000 (23:40 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:55:21 +0000 (14:55 -0800)
Add the struct net * argument to both of them to use in
the future. Also make the register one return an error code.

It is useless right now, but will make the future patches
much simpler.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/af_unix.h
net/unix/af_unix.c
net/unix/sysctl_net_unix.c

index a1c805d7f488b7295a335c33de66f495cd5d0e37..e0fba269d092234b77f722d39cde870c06fce4ad 100644 (file)
@@ -60,11 +60,11 @@ struct unix_sock {
 
 #ifdef CONFIG_SYSCTL
 extern int sysctl_unix_max_dgram_qlen;
-extern void unix_sysctl_register(void);
-extern void unix_sysctl_unregister(void);
+extern int unix_sysctl_register(struct net *net);
+extern void unix_sysctl_unregister(struct net *net);
 #else
-static inline void unix_sysctl_register(void) {}
-static inline void unix_sysctl_unregister(void) {}
+static inline int unix_sysctl_register(struct net *net) { return 0; }
+static inline void unix_sysctl_unregister(struct net *net) {}
 #endif
 #endif
 #endif
index 393197afb1901c3cb5866cacdb8f0e5686636faf..a0aa6d3c2c084ad713979da5dd3778a233d63a64 100644 (file)
@@ -2175,7 +2175,7 @@ static int __init af_unix_init(void)
 
        sock_register(&unix_family_ops);
        register_pernet_subsys(&unix_net_ops);
-       unix_sysctl_register();
+       unix_sysctl_register(&init_net);
 out:
        return rc;
 }
@@ -2183,7 +2183,7 @@ out:
 static void __exit af_unix_exit(void)
 {
        sock_unregister(PF_UNIX);
-       unix_sysctl_unregister();
+       unix_sysctl_unregister(&init_net);
        proto_unregister(&unix_proto);
        unregister_pernet_subsys(&unix_net_ops);
 }
index eb0bd57ebadac12b613e0881f9b6566aa0185cc6..b2e0407e1b7b7685386c208f3180d6a17a6724c9 100644 (file)
@@ -48,12 +48,13 @@ static ctl_table unix_root_table[] = {
 
 static struct ctl_table_header * unix_sysctl_header;
 
-void unix_sysctl_register(void)
+int unix_sysctl_register(struct net *net)
 {
        unix_sysctl_header = register_sysctl_table(unix_root_table);
+       return unix_sysctl_header == NULL ? -ENOMEM : 0;
 }
 
-void unix_sysctl_unregister(void)
+void unix_sysctl_unregister(struct net *net)
 {
        unregister_sysctl_table(unix_sysctl_header);
 }