aboutsummaryrefslogtreecommitdiffstats
path: root/net/ax25/ax25_dev.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-04-19 09:34:18 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-20 21:22:28 -0400
commit0ca7a4c87d27dd2fde0783dec94a821d6d035696 (patch)
tree3f9d1cd9a8146ce751e43f8f103a255fc7ec199d /net/ax25/ax25_dev.c
parent4e5ca78541c549ec8886ad2fc19306f35ee672e1 (diff)
net ax25: Simplify and cleanup the ax25 sysctl handling.
Don't register/unregister every ax25 table in a batch. Instead register and unregister per device ax25 sysctls as ax25 devices come and go. This moves ax25 to be a completely modern sysctl user. Registering the sysctls in just the initial network namespace, removing the use of .child entries that are no longer natively supported by the sysctl core and taking advantage of the fact that there are no longer any ordering constraints between registering and unregistering different sysctl tables. 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/ax25/ax25_dev.c')
-rw-r--r--net/ax25/ax25_dev.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
index d0de30e89591..3d106767b272 100644
--- a/net/ax25/ax25_dev.c
+++ b/net/ax25/ax25_dev.c
@@ -59,8 +59,6 @@ void ax25_dev_device_up(struct net_device *dev)
59 return; 59 return;
60 } 60 }
61 61
62 ax25_unregister_sysctl();
63
64 dev->ax25_ptr = ax25_dev; 62 dev->ax25_ptr = ax25_dev;
65 ax25_dev->dev = dev; 63 ax25_dev->dev = dev;
66 dev_hold(dev); 64 dev_hold(dev);
@@ -90,7 +88,7 @@ void ax25_dev_device_up(struct net_device *dev)
90 ax25_dev_list = ax25_dev; 88 ax25_dev_list = ax25_dev;
91 spin_unlock_bh(&ax25_dev_lock); 89 spin_unlock_bh(&ax25_dev_lock);
92 90
93 ax25_register_sysctl(); 91 ax25_register_dev_sysctl(ax25_dev);
94} 92}
95 93
96void ax25_dev_device_down(struct net_device *dev) 94void ax25_dev_device_down(struct net_device *dev)
@@ -100,7 +98,7 @@ void ax25_dev_device_down(struct net_device *dev)
100 if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) 98 if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
101 return; 99 return;
102 100
103 ax25_unregister_sysctl(); 101 ax25_unregister_dev_sysctl(ax25_dev);
104 102
105 spin_lock_bh(&ax25_dev_lock); 103 spin_lock_bh(&ax25_dev_lock);
106 104
@@ -120,7 +118,6 @@ void ax25_dev_device_down(struct net_device *dev)
120 spin_unlock_bh(&ax25_dev_lock); 118 spin_unlock_bh(&ax25_dev_lock);
121 dev_put(dev); 119 dev_put(dev);
122 kfree(ax25_dev); 120 kfree(ax25_dev);
123 ax25_register_sysctl();
124 return; 121 return;
125 } 122 }
126 123
@@ -130,7 +127,6 @@ void ax25_dev_device_down(struct net_device *dev)
130 spin_unlock_bh(&ax25_dev_lock); 127 spin_unlock_bh(&ax25_dev_lock);
131 dev_put(dev); 128 dev_put(dev);
132 kfree(ax25_dev); 129 kfree(ax25_dev);
133 ax25_register_sysctl();
134 return; 130 return;
135 } 131 }
136 132
@@ -138,8 +134,6 @@ void ax25_dev_device_down(struct net_device *dev)
138 } 134 }
139 spin_unlock_bh(&ax25_dev_lock); 135 spin_unlock_bh(&ax25_dev_lock);
140 dev->ax25_ptr = NULL; 136 dev->ax25_ptr = NULL;
141
142 ax25_register_sysctl();
143} 137}
144 138
145int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd) 139int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd)