diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2015-07-07 07:41:47 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-07-13 11:25:06 +0200 |
commit | 684529b67bb5c9345419a6db1f4689fbb961d65c (patch) | |
tree | 8bf2ed76eb219432ae8ed705b28a546ba868574d | |
parent | 35ffa565eac49cc31654e139d951c5956484698f (diff) |
NET: AX.25: Rename sysctl registration/unregistration functions.rose-fixes-4.2-rc2
The place of these is inconsistent with how other protocols such as IPv4
are handling it so in preparation for moving sysctls, rename registrations
to the old locations.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | include/net/ax25.h | 8 | ||||
-rw-r--r-- | net/ax25/af_ax25.c | 24 | ||||
-rw-r--r-- | net/ax25/ax25_dev.c | 4 | ||||
-rw-r--r-- | net/ax25/sysctl_net_ax25.c | 4 |
4 files changed, 32 insertions, 8 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h index c71ad8e769f8..51812979c3ae 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -458,11 +458,11 @@ void ax25_uid_free(void); /* sysctl_net_ax25.c */ #ifdef CONFIG_SYSCTL -int ax25_register_dev_sysctl(ax25_dev *ax25_dev); -void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev); +int ax25_register_dev_compat_sysctl(ax25_dev *ax25_dev); +void ax25_unregister_dev_compat_sysctl(ax25_dev *ax25_dev); #else -static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; } -static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {} +static inline int ax25_register_dev_compat_sysctl(ax25_dev *ax25_dev) { return 0; } +static inline void ax25_unregister_dev_compat_sysctl(ax25_dev *ax25_dev) {} #endif /* CONFIG_SYSCTL */ #endif diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index ae3a47f9d1d5..a9d05581f29e 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1975,6 +1975,30 @@ static struct notifier_block ax25_dev_notifier = { .notifier_call = ax25_device_event, }; +int sysctl_ax25_compat_sysctl_path = 1; + +static int min_compat[] = {0}, max_compat[] = {1}; + +static struct ctl_table_header *ax25_table_header; + +static struct ctl_table ax25_table[] = { + { + .procname = "compat", + .data = &sysctl_ax25_compat_sysctl_path, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &min_compat, + .extra2 = &max_compat + }, + { } +}; + +void __init nr_register_sysctl(void) +{ + nr_table_header = register_net_sysctl(&init_net, "net/ax25", nr_table); +} + static int __init ax25_init(void) { int rc = proto_register(&ax25_proto, 0); diff --git a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c index 3d106767b272..00cc12165ae2 100644 --- a/net/ax25/ax25_dev.c +++ b/net/ax25/ax25_dev.c @@ -88,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_dev_sysctl(ax25_dev); + ax25_register_dev_compat_sysctl(ax25_dev); } void ax25_dev_device_down(struct net_device *dev) @@ -98,7 +98,7 @@ void ax25_dev_device_down(struct net_device *dev) if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL) return; - ax25_unregister_dev_sysctl(ax25_dev); + ax25_unregister_dev_compat_sysctl(ax25_dev); spin_lock_bh(&ax25_dev_lock); diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c index 919a5ce47515..369365e70c73 100644 --- a/net/ax25/sysctl_net_ax25.c +++ b/net/ax25/sysctl_net_ax25.c @@ -148,7 +148,7 @@ static const struct ctl_table ax25_param_table[] = { { } /* that's all, folks! */ }; -int ax25_register_dev_sysctl(ax25_dev *ax25_dev) +int ax25_register_dev_compat_sysctl(ax25_dev *ax25_dev) { char path[sizeof("net/ax25/") + IFNAMSIZ]; int k; @@ -170,7 +170,7 @@ int ax25_register_dev_sysctl(ax25_dev *ax25_dev) return 0; } -void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) +void ax25_unregister_dev_compat_sysctl(ax25_dev *ax25_dev) { struct ctl_table_header *header = ax25_dev->sysheader; struct ctl_table *table; |