Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97577e38284f48ca773392e2d401af2f6c95dc08
Commit:     97577e38284f48ca773392e2d401af2f6c95dc08
Parent:     dd88590995de7c7ce108718a9ad52b3832e77814
Author:     Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sat Dec 1 23:40:40 2007 +1100
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:55:21 2008 -0800

    [UNIX]: Extend unix_sysctl_(un)register prototypes
    
    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 <[EMAIL PROTECTED]>
    Acked-by: Eric W. Biederman <[EMAIL PROTECTED]>
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/af_unix.h      |    8 ++++----
 net/unix/af_unix.c         |    4 ++--
 net/unix/sysctl_net_unix.c |    5 +++--
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index a1c805d..e0fba26 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -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
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 393197a..a0aa6d3 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -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);
 }
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index eb0bd57..b2e0407 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -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);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to