diff options
Diffstat (limited to 'net/ipv4/af_inet.c')
-rw-r--r-- | net/ipv4/af_inet.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 7d12c6a9b19b..33b7dffa7732 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c | |||
@@ -1385,7 +1385,7 @@ int inet_ctl_sock_create(struct sock **sk, unsigned short family, | |||
1385 | } | 1385 | } |
1386 | EXPORT_SYMBOL_GPL(inet_ctl_sock_create); | 1386 | EXPORT_SYMBOL_GPL(inet_ctl_sock_create); |
1387 | 1387 | ||
1388 | unsigned long snmp_fold_field(void *mib[], int offt) | 1388 | unsigned long snmp_fold_field(void __percpu *mib[], int offt) |
1389 | { | 1389 | { |
1390 | unsigned long res = 0; | 1390 | unsigned long res = 0; |
1391 | int i; | 1391 | int i; |
@@ -1398,7 +1398,7 @@ unsigned long snmp_fold_field(void *mib[], int offt) | |||
1398 | } | 1398 | } |
1399 | EXPORT_SYMBOL_GPL(snmp_fold_field); | 1399 | EXPORT_SYMBOL_GPL(snmp_fold_field); |
1400 | 1400 | ||
1401 | int snmp_mib_init(void *ptr[2], size_t mibsize) | 1401 | int snmp_mib_init(void __percpu *ptr[2], size_t mibsize) |
1402 | { | 1402 | { |
1403 | BUG_ON(ptr == NULL); | 1403 | BUG_ON(ptr == NULL); |
1404 | ptr[0] = __alloc_percpu(mibsize, __alignof__(unsigned long long)); | 1404 | ptr[0] = __alloc_percpu(mibsize, __alignof__(unsigned long long)); |
@@ -1416,7 +1416,7 @@ err0: | |||
1416 | } | 1416 | } |
1417 | EXPORT_SYMBOL_GPL(snmp_mib_init); | 1417 | EXPORT_SYMBOL_GPL(snmp_mib_init); |
1418 | 1418 | ||
1419 | void snmp_mib_free(void *ptr[2]) | 1419 | void snmp_mib_free(void __percpu *ptr[2]) |
1420 | { | 1420 | { |
1421 | BUG_ON(ptr == NULL); | 1421 | BUG_ON(ptr == NULL); |
1422 | free_percpu(ptr[0]); | 1422 | free_percpu(ptr[0]); |
@@ -1460,25 +1460,25 @@ static const struct net_protocol icmp_protocol = { | |||
1460 | 1460 | ||
1461 | static __net_init int ipv4_mib_init_net(struct net *net) | 1461 | static __net_init int ipv4_mib_init_net(struct net *net) |
1462 | { | 1462 | { |
1463 | if (snmp_mib_init((void **)net->mib.tcp_statistics, | 1463 | if (snmp_mib_init((void __percpu **)net->mib.tcp_statistics, |
1464 | sizeof(struct tcp_mib)) < 0) | 1464 | sizeof(struct tcp_mib)) < 0) |
1465 | goto err_tcp_mib; | 1465 | goto err_tcp_mib; |
1466 | if (snmp_mib_init((void **)net->mib.ip_statistics, | 1466 | if (snmp_mib_init((void __percpu **)net->mib.ip_statistics, |
1467 | sizeof(struct ipstats_mib)) < 0) | 1467 | sizeof(struct ipstats_mib)) < 0) |
1468 | goto err_ip_mib; | 1468 | goto err_ip_mib; |
1469 | if (snmp_mib_init((void **)net->mib.net_statistics, | 1469 | if (snmp_mib_init((void __percpu **)net->mib.net_statistics, |
1470 | sizeof(struct linux_mib)) < 0) | 1470 | sizeof(struct linux_mib)) < 0) |
1471 | goto err_net_mib; | 1471 | goto err_net_mib; |
1472 | if (snmp_mib_init((void **)net->mib.udp_statistics, | 1472 | if (snmp_mib_init((void __percpu **)net->mib.udp_statistics, |
1473 | sizeof(struct udp_mib)) < 0) | 1473 | sizeof(struct udp_mib)) < 0) |
1474 | goto err_udp_mib; | 1474 | goto err_udp_mib; |
1475 | if (snmp_mib_init((void **)net->mib.udplite_statistics, | 1475 | if (snmp_mib_init((void __percpu **)net->mib.udplite_statistics, |
1476 | sizeof(struct udp_mib)) < 0) | 1476 | sizeof(struct udp_mib)) < 0) |
1477 | goto err_udplite_mib; | 1477 | goto err_udplite_mib; |
1478 | if (snmp_mib_init((void **)net->mib.icmp_statistics, | 1478 | if (snmp_mib_init((void __percpu **)net->mib.icmp_statistics, |
1479 | sizeof(struct icmp_mib)) < 0) | 1479 | sizeof(struct icmp_mib)) < 0) |
1480 | goto err_icmp_mib; | 1480 | goto err_icmp_mib; |
1481 | if (snmp_mib_init((void **)net->mib.icmpmsg_statistics, | 1481 | if (snmp_mib_init((void __percpu **)net->mib.icmpmsg_statistics, |
1482 | sizeof(struct icmpmsg_mib)) < 0) | 1482 | sizeof(struct icmpmsg_mib)) < 0) |
1483 | goto err_icmpmsg_mib; | 1483 | goto err_icmpmsg_mib; |
1484 | 1484 | ||
@@ -1486,30 +1486,30 @@ static __net_init int ipv4_mib_init_net(struct net *net) | |||
1486 | return 0; | 1486 | return 0; |
1487 | 1487 | ||
1488 | err_icmpmsg_mib: | 1488 | err_icmpmsg_mib: |
1489 | snmp_mib_free((void **)net->mib.icmp_statistics); | 1489 | snmp_mib_free((void __percpu **)net->mib.icmp_statistics); |
1490 | err_icmp_mib: | 1490 | err_icmp_mib: |
1491 | snmp_mib_free((void **)net->mib.udplite_statistics); | 1491 | snmp_mib_free((void __percpu **)net->mib.udplite_statistics); |
1492 | err_udplite_mib: | 1492 | err_udplite_mib: |
1493 | snmp_mib_free((void **)net->mib.udp_statistics); | 1493 | snmp_mib_free((void __percpu **)net->mib.udp_statistics); |
1494 | err_udp_mib: | 1494 | err_udp_mib: |
1495 | snmp_mib_free((void **)net->mib.net_statistics); | 1495 | snmp_mib_free((void __percpu **)net->mib.net_statistics); |
1496 | err_net_mib: | 1496 | err_net_mib: |
1497 | snmp_mib_free((void **)net->mib.ip_statistics); | 1497 | snmp_mib_free((void __percpu **)net->mib.ip_statistics); |
1498 | err_ip_mib: | 1498 | err_ip_mib: |
1499 | snmp_mib_free((void **)net->mib.tcp_statistics); | 1499 | snmp_mib_free((void __percpu **)net->mib.tcp_statistics); |
1500 | err_tcp_mib: | 1500 | err_tcp_mib: |
1501 | return -ENOMEM; | 1501 | return -ENOMEM; |
1502 | } | 1502 | } |
1503 | 1503 | ||
1504 | static __net_exit void ipv4_mib_exit_net(struct net *net) | 1504 | static __net_exit void ipv4_mib_exit_net(struct net *net) |
1505 | { | 1505 | { |
1506 | snmp_mib_free((void **)net->mib.icmpmsg_statistics); | 1506 | snmp_mib_free((void __percpu **)net->mib.icmpmsg_statistics); |
1507 | snmp_mib_free((void **)net->mib.icmp_statistics); | 1507 | snmp_mib_free((void __percpu **)net->mib.icmp_statistics); |
1508 | snmp_mib_free((void **)net->mib.udplite_statistics); | 1508 | snmp_mib_free((void __percpu **)net->mib.udplite_statistics); |
1509 | snmp_mib_free((void **)net->mib.udp_statistics); | 1509 | snmp_mib_free((void __percpu **)net->mib.udp_statistics); |
1510 | snmp_mib_free((void **)net->mib.net_statistics); | 1510 | snmp_mib_free((void __percpu **)net->mib.net_statistics); |
1511 | snmp_mib_free((void **)net->mib.ip_statistics); | 1511 | snmp_mib_free((void __percpu **)net->mib.ip_statistics); |
1512 | snmp_mib_free((void **)net->mib.tcp_statistics); | 1512 | snmp_mib_free((void __percpu **)net->mib.tcp_statistics); |
1513 | } | 1513 | } |
1514 | 1514 | ||
1515 | static __net_initdata struct pernet_operations ipv4_mib_ops = { | 1515 | static __net_initdata struct pernet_operations ipv4_mib_ops = { |