diff options
Diffstat (limited to 'net/netrom')
-rw-r--r-- | net/netrom/af_netrom.c | 7 | ||||
-rw-r--r-- | net/netrom/nr_route.c | 15 | ||||
-rw-r--r-- | net/netrom/sysctl_net_netrom.c | 30 |
3 files changed, 15 insertions, 37 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 7a834952f67f..71604c6613b5 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -425,12 +425,13 @@ static struct proto nr_proto = { .obj_size = sizeof(struct nr_sock), }; -static int nr_create(struct net *net, struct socket *sock, int protocol) +static int nr_create(struct net *net, struct socket *sock, int protocol, + int kern) { struct sock *sk; struct nr_sock *nr; - if (net != &init_net) + if (!net_eq(net, &init_net)) return -EAFNOSUPPORT; if (sock->type != SOCK_SEQPACKET || protocol != 0) @@ -1372,7 +1373,7 @@ static const struct file_operations nr_info_fops = { }; #endif /* CONFIG_PROC_FS */ -static struct net_proto_family nr_family_ops = { +static const struct net_proto_family nr_family_ops = { .family = PF_NETROM, .create = nr_create, .owner = THIS_MODULE, diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c index 4eb1ac9a7679..aacba76070fc 100644 --- a/net/netrom/nr_route.c +++ b/net/netrom/nr_route.c @@ -597,15 +597,15 @@ struct net_device *nr_dev_first(void) { struct net_device *dev, *first = NULL; - read_lock(&dev_base_lock); - for_each_netdev(&init_net, dev) { + rcu_read_lock(); + for_each_netdev_rcu(&init_net, dev) { if ((dev->flags & IFF_UP) && dev->type == ARPHRD_NETROM) if (first == NULL || strncmp(dev->name, first->name, 3) < 0) first = dev; } if (first) dev_hold(first); - read_unlock(&dev_base_lock); + rcu_read_unlock(); return first; } @@ -617,16 +617,17 @@ struct net_device *nr_dev_get(ax25_address *addr) { struct net_device *dev; - read_lock(&dev_base_lock); - for_each_netdev(&init_net, dev) { - if ((dev->flags & IFF_UP) && dev->type == ARPHRD_NETROM && ax25cmp(addr, (ax25_address *)dev->dev_addr) == 0) { + rcu_read_lock(); + for_each_netdev_rcu(&init_net, dev) { + if ((dev->flags & IFF_UP) && dev->type == ARPHRD_NETROM && + ax25cmp(addr, (ax25_address *)dev->dev_addr) == 0) { dev_hold(dev); goto out; } } dev = NULL; out: - read_unlock(&dev_base_lock); + rcu_read_unlock(); return dev; } diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c index 7b49591fe87c..1e0fa9e57aac 100644 --- a/net/netrom/sysctl_net_netrom.c +++ b/net/netrom/sysctl_net_netrom.c @@ -36,143 +36,119 @@ static struct ctl_table_header *nr_table_header; static ctl_table nr_table[] = { { - .ctl_name = NET_NETROM_DEFAULT_PATH_QUALITY, .procname = "default_path_quality", .data = &sysctl_netrom_default_path_quality, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_quality, .extra2 = &max_quality }, { - .ctl_name = NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, .procname = "obsolescence_count_initialiser", .data = &sysctl_netrom_obsolescence_count_initialiser, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_obs, .extra2 = &max_obs }, { - .ctl_name = NET_NETROM_NETWORK_TTL_INITIALISER, .procname = "network_ttl_initialiser", .data = &sysctl_netrom_network_ttl_initialiser, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_ttl, .extra2 = &max_ttl }, { - .ctl_name = NET_NETROM_TRANSPORT_TIMEOUT, .procname = "transport_timeout", .data = &sysctl_netrom_transport_timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_t1, .extra2 = &max_t1 }, { - .ctl_name = NET_NETROM_TRANSPORT_MAXIMUM_TRIES, .procname = "transport_maximum_tries", .data = &sysctl_netrom_transport_maximum_tries, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_n2, .extra2 = &max_n2 }, { - .ctl_name = NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, .procname = "transport_acknowledge_delay", .data = &sysctl_netrom_transport_acknowledge_delay, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_t2, .extra2 = &max_t2 }, { - .ctl_name = NET_NETROM_TRANSPORT_BUSY_DELAY, .procname = "transport_busy_delay", .data = &sysctl_netrom_transport_busy_delay, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_t4, .extra2 = &max_t4 }, { - .ctl_name = NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, .procname = "transport_requested_window_size", .data = &sysctl_netrom_transport_requested_window_size, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_window, .extra2 = &max_window }, { - .ctl_name = NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, .procname = "transport_no_activity_timeout", .data = &sysctl_netrom_transport_no_activity_timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_idle, .extra2 = &max_idle }, { - .ctl_name = NET_NETROM_ROUTING_CONTROL, .procname = "routing_control", .data = &sysctl_netrom_routing_control, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_route, .extra2 = &max_route }, { - .ctl_name = NET_NETROM_LINK_FAILS_COUNT, .procname = "link_fails_count", .data = &sysctl_netrom_link_fails_count, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_fails, .extra2 = &max_fails }, { - .ctl_name = NET_NETROM_RESET, .procname = "reset", .data = &sysctl_netrom_reset_circuit, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_reset, .extra2 = &max_reset }, - { .ctl_name = 0 } + { } }; static struct ctl_path nr_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "netrom", .ctl_name = NET_NETROM, }, + { .procname = "net", }, + { .procname = "netrom", }, { } }; |