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>
This commit is contained in:

committed by
David S. Miller

parent
4e5ca78541
commit
0ca7a4c87d
@@ -59,8 +59,6 @@ void ax25_dev_device_up(struct net_device *dev)
|
||||
return;
|
||||
}
|
||||
|
||||
ax25_unregister_sysctl();
|
||||
|
||||
dev->ax25_ptr = ax25_dev;
|
||||
ax25_dev->dev = dev;
|
||||
dev_hold(dev);
|
||||
@@ -90,7 +88,7 @@ void ax25_dev_device_up(struct net_device *dev)
|
||||
ax25_dev_list = ax25_dev;
|
||||
spin_unlock_bh(&ax25_dev_lock);
|
||||
|
||||
ax25_register_sysctl();
|
||||
ax25_register_dev_sysctl(ax25_dev);
|
||||
}
|
||||
|
||||
void ax25_dev_device_down(struct net_device *dev)
|
||||
@@ -100,7 +98,7 @@ void ax25_dev_device_down(struct net_device *dev)
|
||||
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
|
||||
return;
|
||||
|
||||
ax25_unregister_sysctl();
|
||||
ax25_unregister_dev_sysctl(ax25_dev);
|
||||
|
||||
spin_lock_bh(&ax25_dev_lock);
|
||||
|
||||
@@ -120,7 +118,6 @@ void ax25_dev_device_down(struct net_device *dev)
|
||||
spin_unlock_bh(&ax25_dev_lock);
|
||||
dev_put(dev);
|
||||
kfree(ax25_dev);
|
||||
ax25_register_sysctl();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -130,7 +127,6 @@ void ax25_dev_device_down(struct net_device *dev)
|
||||
spin_unlock_bh(&ax25_dev_lock);
|
||||
dev_put(dev);
|
||||
kfree(ax25_dev);
|
||||
ax25_register_sysctl();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -138,8 +134,6 @@ void ax25_dev_device_down(struct net_device *dev)
|
||||
}
|
||||
spin_unlock_bh(&ax25_dev_lock);
|
||||
dev->ax25_ptr = NULL;
|
||||
|
||||
ax25_register_sysctl();
|
||||
}
|
||||
|
||||
int ax25_fwd_ioctl(unsigned int cmd, struct ax25_fwd_struct *fwd)
|
||||
|
Reference in New Issue
Block a user