aboutsummaryrefslogtreecommitdiffstats
path: root/net/rds
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-04-19 09:24:33 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-20 21:21:17 -0400
commit5dd3df105b9f6cb7dd2472b59e028d0d1c878ecb (patch)
treeb12606e6e74ee6d07823eb268e09d899946279fd /net/rds
parent4344475797a16ef948385780943f7a5cf09f0675 (diff)
net: Move all of the network sysctls without a namespace into init_net.
This makes it clearer which sysctls are relative to your current network namespace. This makes it a little less error prone by not exposing sysctls for the initial network namespace in other namespaces. This is the same way we handle all of our other network interfaces to userspace and I can't honestly remember why we didn't do this for sysctls right from the start. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r--net/rds/ib_sysctl.c4
-rw-r--r--net/rds/iw_sysctl.c4
-rw-r--r--net/rds/sysctl.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c
index 1253b006efdb..0fef3e15777b 100644
--- a/net/rds/ib_sysctl.c
+++ b/net/rds/ib_sysctl.c
@@ -116,12 +116,12 @@ static struct ctl_path rds_ib_sysctl_path[] = {
116void rds_ib_sysctl_exit(void) 116void rds_ib_sysctl_exit(void)
117{ 117{
118 if (rds_ib_sysctl_hdr) 118 if (rds_ib_sysctl_hdr)
119 unregister_sysctl_table(rds_ib_sysctl_hdr); 119 unregister_net_sysctl_table(rds_ib_sysctl_hdr);
120} 120}
121 121
122int rds_ib_sysctl_init(void) 122int rds_ib_sysctl_init(void)
123{ 123{
124 rds_ib_sysctl_hdr = register_sysctl_paths(rds_ib_sysctl_path, rds_ib_sysctl_table); 124 rds_ib_sysctl_hdr = register_net_sysctl_table(&init_net, rds_ib_sysctl_path, rds_ib_sysctl_table);
125 if (!rds_ib_sysctl_hdr) 125 if (!rds_ib_sysctl_hdr)
126 return -ENOMEM; 126 return -ENOMEM;
127 return 0; 127 return 0;
diff --git a/net/rds/iw_sysctl.c b/net/rds/iw_sysctl.c
index e2e47176e729..bcfe36dc55a7 100644
--- a/net/rds/iw_sysctl.c
+++ b/net/rds/iw_sysctl.c
@@ -119,12 +119,12 @@ static struct ctl_path rds_iw_sysctl_path[] = {
119void rds_iw_sysctl_exit(void) 119void rds_iw_sysctl_exit(void)
120{ 120{
121 if (rds_iw_sysctl_hdr) 121 if (rds_iw_sysctl_hdr)
122 unregister_sysctl_table(rds_iw_sysctl_hdr); 122 unregister_net_sysctl_table(rds_iw_sysctl_hdr);
123} 123}
124 124
125int rds_iw_sysctl_init(void) 125int rds_iw_sysctl_init(void)
126{ 126{
127 rds_iw_sysctl_hdr = register_sysctl_paths(rds_iw_sysctl_path, rds_iw_sysctl_table); 127 rds_iw_sysctl_hdr = register_net_sysctl_table(&init_net, rds_iw_sysctl_path, rds_iw_sysctl_table);
128 if (!rds_iw_sysctl_hdr) 128 if (!rds_iw_sysctl_hdr)
129 return -ENOMEM; 129 return -ENOMEM;
130 return 0; 130 return 0;
diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index 25ad0c77a26c..30354b8cd584 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -102,7 +102,7 @@ static struct ctl_path rds_sysctl_path[] = {
102void rds_sysctl_exit(void) 102void rds_sysctl_exit(void)
103{ 103{
104 if (rds_sysctl_reg_table) 104 if (rds_sysctl_reg_table)
105 unregister_sysctl_table(rds_sysctl_reg_table); 105 unregister_net_sysctl_table(rds_sysctl_reg_table);
106} 106}
107 107
108int rds_sysctl_init(void) 108int rds_sysctl_init(void)
@@ -110,7 +110,7 @@ int rds_sysctl_init(void)
110 rds_sysctl_reconnect_min = msecs_to_jiffies(1); 110 rds_sysctl_reconnect_min = msecs_to_jiffies(1);
111 rds_sysctl_reconnect_min_jiffies = rds_sysctl_reconnect_min; 111 rds_sysctl_reconnect_min_jiffies = rds_sysctl_reconnect_min;
112 112
113 rds_sysctl_reg_table = register_sysctl_paths(rds_sysctl_path, rds_sysctl_rds_table); 113 rds_sysctl_reg_table = register_net_sysctl_table(&init_net, rds_sysctl_path, rds_sysctl_rds_table);
114 if (!rds_sysctl_reg_table) 114 if (!rds_sysctl_reg_table)
115 return -ENOMEM; 115 return -ENOMEM;
116 return 0; 116 return 0;