aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2005-12-22 15:43:42 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:11:14 -0500
commit77d76ea310b50a9c8ff15bd290fcb4ed4961adf2 (patch)
tree7d6e8b2426d4b3debe5ddf838ab2a2ef13f1b106
parent7708610b1bff4a0ba8a73733d3c7c4bda9f94b21 (diff)
[NET]: Small cleanup to socket initialization
sock_init can be done as a core_initcall instead of calling it directly in init/main.c Also I removed an out of date #ifdef. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/skbuff.h1
-rw-r--r--include/linux/socket.h1
-rw-r--r--init/main.c4
-rw-r--r--net/socket.c10
4 files changed, 5 insertions, 11 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 97f6580ce039..971677178e0c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -32,7 +32,6 @@
32 32
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 33#define HAVE_ALLOC_SKB /* For the drivers to know */
34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
35#define SLAB_SKB /* Slabified skbuffs */
36 35
37#define CHECKSUM_NONE 0 36#define CHECKSUM_NONE 0
38#define CHECKSUM_HW 1 37#define CHECKSUM_HW 1
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 1739c2d5b95b..9f4019156fd8 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -27,7 +27,6 @@ struct __kernel_sockaddr_storage {
27#include <linux/compiler.h> /* __user */ 27#include <linux/compiler.h> /* __user */
28 28
29extern int sysctl_somaxconn; 29extern int sysctl_somaxconn;
30extern void sock_init(void);
31#ifdef CONFIG_PROC_FS 30#ifdef CONFIG_PROC_FS
32struct seq_file; 31struct seq_file;
33extern void socket_seq_show(struct seq_file *seq); 32extern void socket_seq_show(struct seq_file *seq);
diff --git a/init/main.c b/init/main.c
index 27f97f9b4636..54aaf561cf66 100644
--- a/init/main.c
+++ b/init/main.c
@@ -47,7 +47,6 @@
47#include <linux/rmap.h> 47#include <linux/rmap.h>
48#include <linux/mempolicy.h> 48#include <linux/mempolicy.h>
49#include <linux/key.h> 49#include <linux/key.h>
50#include <net/sock.h>
51 50
52#include <asm/io.h> 51#include <asm/io.h>
53#include <asm/bugs.h> 52#include <asm/bugs.h>
@@ -614,9 +613,6 @@ static void __init do_basic_setup(void)
614 sysctl_init(); 613 sysctl_init();
615#endif 614#endif
616 615
617 /* Networking initialization needs a process context */
618 sock_init();
619
620 do_initcalls(); 616 do_initcalls();
621} 617}
622 618
diff --git a/net/socket.c b/net/socket.c
index 3145103cdf54..98be7ef3c086 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2036,7 +2036,7 @@ int sock_unregister(int family)
2036 return 0; 2036 return 0;
2037} 2037}
2038 2038
2039void __init sock_init(void) 2039static int __init sock_init(void)
2040{ 2040{
2041 /* 2041 /*
2042 * Initialize sock SLAB cache. 2042 * Initialize sock SLAB cache.
@@ -2044,12 +2044,10 @@ void __init sock_init(void)
2044 2044
2045 sk_init(); 2045 sk_init();
2046 2046
2047#ifdef SLAB_SKB
2048 /* 2047 /*
2049 * Initialize skbuff SLAB cache 2048 * Initialize skbuff SLAB cache
2050 */ 2049 */
2051 skb_init(); 2050 skb_init();
2052#endif
2053 2051
2054 /* 2052 /*
2055 * Initialize the protocols module. 2053 * Initialize the protocols module.
@@ -2058,8 +2056,8 @@ void __init sock_init(void)
2058 init_inodecache(); 2056 init_inodecache();
2059 register_filesystem(&sock_fs_type); 2057 register_filesystem(&sock_fs_type);
2060 sock_mnt = kern_mount(&sock_fs_type); 2058 sock_mnt = kern_mount(&sock_fs_type);
2061 /* The real protocol initialization is performed when 2059
2062 * do_initcalls is run. 2060 /* The real protocol initialization is performed in later initcalls.
2063 */ 2061 */
2064 2062
2065#ifdef CONFIG_NETFILTER 2063#ifdef CONFIG_NETFILTER
@@ -2067,6 +2065,8 @@ void __init sock_init(void)
2067#endif 2065#endif
2068} 2066}
2069 2067
2068core_initcall(sock_init); /* early initcall */
2069
2070#ifdef CONFIG_PROC_FS 2070#ifdef CONFIG_PROC_FS
2071void socket_seq_show(struct seq_file *seq) 2071void socket_seq_show(struct seq_file *seq)
2072{ 2072{