[Devel] [PATCH 3/3] proc-net: virtualize all the network proc entries
Stanislav Kinsburskiy
skinsbursky at virtuozzo.com
Fri Jul 21 08:14:32 MSK 2017
20 июля 2017 г. 23:34 пользователь Andrey Vagin <avagin at virtuozzo.com> написал:
On Thu, Jul 20, 2017 at 08:47:58PM +0400, Stanislav Kinsburskiy wrote:
> Use proc_net_create() and proc_net_create_data() for all the per-net dentries.
> We need this to expose per-net sysfs dentries once commit
> e5990221bde54d757a5b5d85e81b2535064570ad is reverted
Could you give more details? Do you mean proc dentries?
Yes, my bad. Should be "proc" instead of "sysfs.
Thanks.
>
> Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
> ---
> drivers/net/ppp/pppoe.c | 2 +-
> net/bluetooth/af_bluetooth.c | 2 +-
> net/core/net-procfs.c | 8 ++++----
> net/core/pktgen.c | 2 +-
> net/core/sock.c | 2 +-
> net/ipv4/arp.c | 2 +-
> net/ipv4/fib_trie.c | 6 +++---
> net/ipv4/igmp.c | 4 ++--
> net/ipv4/ipmr.c | 4 ++--
> net/ipv4/netfilter/ipt_CLUSTERIP.c | 2 +-
> .../netfilter/nf_conntrack_l3proto_ipv4_compat.c | 8 ++++----
> net/ipv4/ping.c | 2 +-
> net/ipv4/proc.c | 6 +++---
> net/ipv4/raw.c | 2 +-
> net/ipv4/route.c | 10 +++++-----
> net/ipv6/addrconf.c | 2 +-
> net/ipv6/anycast.c | 2 +-
> net/ipv6/ip6_flowlabel.c | 2 +-
> net/ipv6/ip6mr.c | 4 ++--
> net/ipv6/mcast.c | 4 ++--
> net/ipv6/proc.c | 4 ++--
> net/ipv6/raw.c | 2 +-
> net/ipv6/route.c | 4 ++--
> net/key/af_key.c | 2 +-
> net/l2tp/l2tp_ppp.c | 2 +-
> net/netfilter/ipvs/ip_vs_app.c | 2 +-
> net/netfilter/ipvs/ip_vs_conn.c | 4 ++--
> net/netfilter/ipvs/ip_vs_ctl.c | 6 +++---
> net/netfilter/nf_conntrack_expect.c | 2 +-
> net/netfilter/nf_conntrack_standalone.c | 6 +++---
> net/netfilter/nf_synproxy_core.c | 2 +-
> net/netlink/af_netlink.c | 2 +-
> net/packet/af_packet.c | 2 +-
> net/phonet/pn_dev.c | 2 +-
> net/sched/sch_api.c | 2 +-
> net/unix/af_unix.c | 2 +-
> net/wireless/wext-proc.c | 2 +-
> net/xfrm/xfrm_proc.c | 2 +-
> 38 files changed, 63 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
> index afa3299..faa8ffa 100644
> --- a/drivers/net/ppp/pppoe.c
> +++ b/drivers/net/ppp/pppoe.c
> @@ -1166,7 +1166,7 @@ static __net_init int pppoe_init_net(struct net *net)
>
> rwlock_init(&pn->hash_lock);
>
> - pde = proc_create("pppoe", S_IRUGO, net->proc_net, &pppoe_seq_fops);
> + pde = proc_net_create("pppoe", S_IRUGO, net->proc_net, &pppoe_seq_fops);
> #ifdef CONFIG_PROC_FS
> if (!pde)
> return -ENOMEM;
> diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c
> index d5d9422..f0f03ad 100644
> --- a/net/bluetooth/af_bluetooth.c
> +++ b/net/bluetooth/af_bluetooth.c
> @@ -674,7 +674,7 @@ int bt_procfs_init(struct net *net, const char *name,
> {
> sk_list->custom_seq_show = seq_show;
>
> - if (!proc_create_data(name, 0, net->proc_net, &bt_fops, sk_list))
> + if (!proc_net_create_data(name, 0, net->proc_net, &bt_fops, sk_list))
> return -ENOMEM;
> return 0;
> }
> diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c
> index 569d355..0ea5ce9 100644
> --- a/net/core/net-procfs.c
> +++ b/net/core/net-procfs.c
> @@ -304,12 +304,12 @@ static int __net_init dev_proc_net_init(struct net *net)
> {
> int rc = -ENOMEM;
>
> - if (!proc_create("dev", S_IRUGO, net->proc_net, &dev_seq_fops))
> + if (!proc_net_create("dev", S_IRUGO, net->proc_net, &dev_seq_fops))
> goto out;
> - if (!proc_create("softnet_stat", S_IRUGO, net->proc_net,
> + if (!proc_net_create("softnet_stat", S_IRUGO, net->proc_net,
> &softnet_seq_fops))
> goto out_dev;
> - if (!proc_create("ptype", S_IRUGO, net->proc_net, &ptype_seq_fops))
> + if (!proc_net_create("ptype", S_IRUGO, net->proc_net, &ptype_seq_fops))
> goto out_softnet;
>
> if (wext_proc_init(net))
> @@ -387,7 +387,7 @@ static const struct file_operations dev_mc_seq_fops = {
>
> static int __net_init dev_mc_net_init(struct net *net)
> {
> - if (!proc_create("dev_mcast", 0, net->proc_net, &dev_mc_seq_fops))
> + if (!proc_net_create("dev_mcast", 0, net->proc_net, &dev_mc_seq_fops))
> return -ENOMEM;
> return 0;
> }
> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index 49c1ef5..8b7d3be 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -3661,7 +3661,7 @@ static int __net_init pg_net_init(struct net *net)
> pn->net = net;
> INIT_LIST_HEAD(&pn->pktgen_threads);
> pn->pktgen_exiting = false;
> - pn->proc_dir = proc_mkdir(PG_PROC_DIR, pn->net->proc_net);
> + pn->proc_dir = proc_net_mkdir(pn->net, PG_PROC_DIR, pn->net->proc_net);
> if (!pn->proc_dir) {
> pr_warn("cannot create /proc/net/%s\n", PG_PROC_DIR);
> return -ENODEV;
> diff --git a/net/core/sock.c b/net/core/sock.c
> index f74fcc2..50fad24 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -2924,7 +2924,7 @@ static const struct file_operations proto_seq_fops = {
>
> static __net_init int proto_init_net(struct net *net)
> {
> - if (!proc_create("protocols", S_IRUGO, net->proc_net, &proto_seq_fops))
> + if (!proc_net_create("protocols", S_IRUGO, net->proc_net, &proto_seq_fops))
> return -ENOMEM;
>
> return 0;
> diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
> index 376534c..93ad65f 100644
> --- a/net/ipv4/arp.c
> +++ b/net/ipv4/arp.c
> @@ -1447,7 +1447,7 @@ static const struct file_operations arp_seq_fops = {
>
> static int __net_init arp_net_init(struct net *net)
> {
> - if (!proc_create("arp", S_IRUGO, net->proc_net, &arp_seq_fops))
> + if (!proc_net_create("arp", S_IRUGO, net->proc_net, &arp_seq_fops))
> return -ENOMEM;
> return 0;
> }
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index 0787d97..a55098e 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -2374,14 +2374,14 @@ static const struct file_operations fib_route_fops = {
>
> int __net_init fib_proc_init(struct net *net)
> {
> - if (!proc_create("fib_trie", S_IRUGO, net->proc_net, &fib_trie_fops))
> + if (!proc_net_create("fib_trie", S_IRUGO, net->proc_net, &fib_trie_fops))
> goto out1;
>
> - if (!proc_create("fib_triestat", S_IRUGO, net->proc_net,
> + if (!proc_net_create("fib_triestat", S_IRUGO, net->proc_net,
> &fib_triestat_fops))
> goto out2;
>
> - if (!proc_create("route", S_IRUGO, net->proc_net, &fib_route_fops))
> + if (!proc_net_create("route", S_IRUGO, net->proc_net, &fib_route_fops))
> goto out3;
>
> return 0;
> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> index 15b4fce..6ea0236 100644
> --- a/net/ipv4/igmp.c
> +++ b/net/ipv4/igmp.c
> @@ -2641,10 +2641,10 @@ static int __net_init igmp_net_init(struct net *net)
> struct proc_dir_entry *pde;
> int err;
>
> - pde = proc_create("igmp", S_IRUGO, net->proc_net, &igmp_mc_seq_fops);
> + pde = proc_net_create("igmp", S_IRUGO, net->proc_net, &igmp_mc_seq_fops);
> if (!pde)
> goto out_igmp;
> - pde = proc_create("mcfilter", S_IRUGO, net->proc_net,
> + pde = proc_net_create("mcfilter", S_IRUGO, net->proc_net,
> &igmp_mcf_seq_fops);
> if (!pde)
> goto out_mcfilter;
> diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
> index e88822e..e3ff3aa 100644
> --- a/net/ipv4/ipmr.c
> +++ b/net/ipv4/ipmr.c
> @@ -2718,9 +2718,9 @@ static int __net_init ipmr_net_init(struct net *net)
>
> #ifdef CONFIG_PROC_FS
> err = -ENOMEM;
> - if (!proc_create("ip_mr_vif", 0, net->proc_net, &ipmr_vif_fops))
> + if (!proc_net_create("ip_mr_vif", 0, net->proc_net, &ipmr_vif_fops))
> goto proc_vif_fail;
> - if (!proc_create("ip_mr_cache", 0, net->proc_net, &ipmr_mfc_fops))
> + if (!proc_net_create("ip_mr_cache", 0, net->proc_net, &ipmr_mfc_fops))
> goto proc_cache_fail;
> #endif
> return 0;
> diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> index 1a2d03e..e8309b8 100644
> --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c
> +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c
> @@ -727,7 +727,7 @@ static int clusterip_net_init(struct net *net)
> spin_lock_init(&cn->lock);
>
> #ifdef CONFIG_PROC_FS
> - cn->procdir = proc_mkdir("ipt_CLUSTERIP", net->proc_net);
> + cn->procdir = proc_net_mkdir(net, "ipt_CLUSTERIP", net->proc_net);
> if (!cn->procdir) {
> pr_err("Unable to proc dir entry\n");
> return -ENOMEM;
> diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> index 869aa9c..2032221 100644
> --- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> +++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c
> @@ -418,17 +418,17 @@ static int __net_init ip_conntrack_net_init(struct net *net)
> {
> struct proc_dir_entry *proc, *proc_exp, *proc_stat;
>
> - proc = proc_create("ip_conntrack", 0440, net->proc_net, &ct_file_ops);
> + proc = proc_net_create("ip_conntrack", 0440, net->proc_net, &ct_file_ops);
> if (!proc)
> goto err1;
>
> - proc_exp = proc_create("ip_conntrack_expect", 0440, net->proc_net,
> + proc_exp = proc_net_create("ip_conntrack_expect", 0440, net->proc_net,
> &ip_exp_file_ops);
> if (!proc_exp)
> goto err2;
>
> - proc_stat = proc_net_create_data("ip_conntrack", S_IRUGO,
> - net->proc_net_stat, &ct_cpu_seq_fops, NULL);
> + proc_stat = proc_net_create("ip_conntrack", S_IRUGO,
> + net->proc_net_stat, &ct_cpu_seq_fops);
> if (!proc_stat)
> goto err3;
> return 0;
> diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
> index 0d81d31..eefa838 100644
> --- a/net/ipv4/ping.c
> +++ b/net/ipv4/ping.c
> @@ -898,7 +898,7 @@ static int ping_proc_register(struct net *net)
> struct proc_dir_entry *p;
> int rc = 0;
>
> - p = proc_create("icmp", S_IRUGO, net->proc_net, &ping_seq_fops);
> + p = proc_net_create("icmp", S_IRUGO, net->proc_net, &ping_seq_fops);
> if (!p)
> rc = -ENOMEM;
> return rc;
> diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
> index 87665be..1c8f3a5 100644
> --- a/net/ipv4/proc.c
> +++ b/net/ipv4/proc.c
> @@ -501,12 +501,12 @@ static const struct file_operations netstat_seq_fops = {
>
> static __net_init int ip_proc_init_net(struct net *net)
> {
> - if (!proc_create("sockstat", S_IRUGO, net->proc_net,
> + if (!proc_net_create("sockstat", S_IRUGO, net->proc_net,
> &sockstat_seq_fops))
> goto out_sockstat;
> - if (!proc_create("netstat", S_IRUGO, net->proc_net, &netstat_seq_fops))
> + if (!proc_net_create("netstat", S_IRUGO, net->proc_net, &netstat_seq_fops))
> goto out_netstat;
> - if (!proc_create("snmp", S_IRUGO, net->proc_net, &snmp_seq_fops))
> + if (!proc_net_create("snmp", S_IRUGO, net->proc_net, &snmp_seq_fops))
> goto out_snmp;
>
> return 0;
> diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
> index 3a38afd..d5d3290 100644
> --- a/net/ipv4/raw.c
> +++ b/net/ipv4/raw.c
> @@ -1051,7 +1051,7 @@ static const struct file_operations raw_seq_fops = {
>
> static __net_init int raw_init_net(struct net *net)
> {
> - if (!proc_create("raw", S_IRUGO, net->proc_net, &raw_seq_fops))
> + if (!proc_net_create("raw", S_IRUGO, net->proc_net, &raw_seq_fops))
> return -ENOMEM;
>
> return 0;
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 6b7313f..f72fd17 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -385,19 +385,19 @@ static int __net_init ip_rt_do_proc_init(struct net *net)
> {
> struct proc_dir_entry *pde;
>
> - pde = proc_create("rt_cache", S_IRUGO, net->proc_net,
> + pde = proc_net_create("rt_cache", S_IRUGO, net->proc_net,
> &rt_cache_seq_fops);
> if (!pde)
> goto err1;
>
> - pde = proc_net_create_data("rt_cache", S_IRUGO,
> - net->proc_net_stat, &rt_cpu_seq_fops, NULL);
> + pde = proc_net_create("rt_cache", S_IRUGO,
> + net->proc_net_stat, &rt_cpu_seq_fops);
> if (!pde)
> goto err2;
>
> #ifdef CONFIG_IP_ROUTE_CLASSID
> - pde = proc_net_create_data("rt_acct", 0,
> - net->proc_net, &rt_acct_proc_fops, NULL);
> + pde = proc_net_create("rt_acct", 0,
> + net->proc_net, &rt_acct_proc_fops);
> if (!pde)
> goto err3;
> #endif
> diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
> index 8d510e2..f5c27ae 100644
> --- a/net/ipv6/addrconf.c
> +++ b/net/ipv6/addrconf.c
> @@ -3562,7 +3562,7 @@ static const struct file_operations if6_fops = {
>
> static int __net_init if6_proc_net_init(struct net *net)
> {
> - if (!proc_create("if_inet6", S_IRUGO, net->proc_net, &if6_fops))
> + if (!proc_net_create("if_inet6", S_IRUGO, net->proc_net, &if6_fops))
> return -ENOMEM;
> return 0;
> }
> diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
> index b0f207a..71db4fa 100644
> --- a/net/ipv6/anycast.c
> +++ b/net/ipv6/anycast.c
> @@ -500,7 +500,7 @@ static const struct file_operations ac6_seq_fops = {
>
> int __net_init ac6_proc_init(struct net *net)
> {
> - if (!proc_create("anycast6", S_IRUGO, net->proc_net, &ac6_seq_fops))
> + if (!proc_net_create("anycast6", S_IRUGO, net->proc_net, &ac6_seq_fops))
> return -ENOMEM;
>
> return 0;
> diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
> index 9793548..27c83c7 100644
> --- a/net/ipv6/ip6_flowlabel.c
> +++ b/net/ipv6/ip6_flowlabel.c
> @@ -780,7 +780,7 @@ static const struct file_operations ip6fl_seq_fops = {
>
> static int __net_init ip6_flowlabel_proc_init(struct net *net)
> {
> - if (!proc_create("ip6_flowlabel", S_IRUGO, net->proc_net,
> + if (!proc_net_create("ip6_flowlabel", S_IRUGO, net->proc_net,
> &ip6fl_seq_fops))
> return -ENOMEM;
> return 0;
> diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
> index e51ddb9..a32e45b 100644
> --- a/net/ipv6/ip6mr.c
> +++ b/net/ipv6/ip6mr.c
> @@ -1367,9 +1367,9 @@ static int __net_init ip6mr_net_init(struct net *net)
>
> #ifdef CONFIG_PROC_FS
> err = -ENOMEM;
> - if (!proc_create("ip6_mr_vif", 0, net->proc_net, &ip6mr_vif_fops))
> + if (!proc_net_create("ip6_mr_vif", 0, net->proc_net, &ip6mr_vif_fops))
> goto proc_vif_fail;
> - if (!proc_create("ip6_mr_cache", 0, net->proc_net, &ip6mr_mfc_fops))
> + if (!proc_net_create("ip6_mr_cache", 0, net->proc_net, &ip6mr_mfc_fops))
> goto proc_cache_fail;
> #endif
>
> diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
> index b998bd3..f69452f 100644
> --- a/net/ipv6/mcast.c
> +++ b/net/ipv6/mcast.c
> @@ -2877,9 +2877,9 @@ static int __net_init igmp6_proc_init(struct net *net)
> int err;
>
> err = -ENOMEM;
> - if (!proc_create("igmp6", S_IRUGO, net->proc_net, &igmp6_mc_seq_fops))
> + if (!proc_net_create("igmp6", S_IRUGO, net->proc_net, &igmp6_mc_seq_fops))
> goto out;
> - if (!proc_create("mcfilter6", S_IRUGO, net->proc_net,
> + if (!proc_net_create("mcfilter6", S_IRUGO, net->proc_net,
> &igmp6_mcf_seq_fops))
> goto out_proc_net_igmp6;
>
> diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
> index 3393f01..09119b1 100644
> --- a/net/ipv6/proc.c
> +++ b/net/ipv6/proc.c
> @@ -302,11 +302,11 @@ int snmp6_unregister_dev(struct inet6_dev *idev)
>
> static int __net_init ipv6_proc_init_net(struct net *net)
> {
> - if (!proc_create("sockstat6", S_IRUGO, net->proc_net,
> + if (!proc_net_create("sockstat6", S_IRUGO, net->proc_net,
> &sockstat6_seq_fops))
> return -ENOMEM;
>
> - if (!proc_create("snmp6", S_IRUGO, net->proc_net, &snmp6_seq_fops))
> + if (!proc_net_create("snmp6", S_IRUGO, net->proc_net, &snmp6_seq_fops))
> goto proc_snmp6_fail;
>
> net->mib.proc_net_devsnmp6 = proc_net_mkdir(net, "dev_snmp6", net->proc_net);
> diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
> index 2b00540..722cfcb 100644
> --- a/net/ipv6/raw.c
> +++ b/net/ipv6/raw.c
> @@ -1280,7 +1280,7 @@ static const struct file_operations raw6_seq_fops = {
>
> static int __net_init raw6_init_net(struct net *net)
> {
> - if (!proc_create("raw6", S_IRUGO, net->proc_net, &raw6_seq_fops))
> + if (!proc_net_create("raw6", S_IRUGO, net->proc_net, &raw6_seq_fops))
> return -ENOMEM;
>
> return 0;
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index fa0e036..c7264cb 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -3493,8 +3493,8 @@ static void __net_exit ip6_route_net_exit(struct net *net)
> static int __net_init ip6_route_net_init_late(struct net *net)
> {
> #ifdef CONFIG_PROC_FS
> - proc_create("ipv6_route", 0, net->proc_net, &ipv6_route_proc_fops);
> - proc_create("rt6_stats", S_IRUGO, net->proc_net, &rt6_stats_seq_fops);
> + proc_net_create("ipv6_route", 0, net->proc_net, &ipv6_route_proc_fops);
> + proc_net_create("rt6_stats", S_IRUGO, net->proc_net, &rt6_stats_seq_fops);
> #endif
> return 0;
> }
> diff --git a/net/key/af_key.c b/net/key/af_key.c
> index 00bca84..69917d5 100644
> --- a/net/key/af_key.c
> +++ b/net/key/af_key.c
> @@ -3779,7 +3779,7 @@ static int __net_init pfkey_init_proc(struct net *net)
> {
> struct proc_dir_entry *e;
>
> - e = proc_create("pfkey", 0, net->proc_net, &pfkey_proc_ops);
> + e = proc_net_create("pfkey", 0, net->proc_net, &pfkey_proc_ops);
> if (e == NULL)
> return -ENOMEM;
>
> diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
> index a819c36..84b1675 100644
> --- a/net/l2tp/l2tp_ppp.c
> +++ b/net/l2tp/l2tp_ppp.c
> @@ -1751,7 +1751,7 @@ static __net_init int pppol2tp_init_net(struct net *net)
> struct proc_dir_entry *pde;
> int err = 0;
>
> - pde = proc_create("pppol2tp", S_IRUGO, net->proc_net,
> + pde = proc_net_create("pppol2tp", S_IRUGO, net->proc_net,
> &pppol2tp_proc_fops);
> if (!pde) {
> err = -ENOMEM;
> diff --git a/net/netfilter/ipvs/ip_vs_app.c b/net/netfilter/ipvs/ip_vs_app.c
> index dfd7b65..09cae1c 100644
> --- a/net/netfilter/ipvs/ip_vs_app.c
> +++ b/net/netfilter/ipvs/ip_vs_app.c
> @@ -616,7 +616,7 @@ int __net_init ip_vs_app_net_init(struct net *net)
> struct netns_ipvs *ipvs = net_ipvs(net);
>
> INIT_LIST_HEAD(&ipvs->app_list);
> - proc_create("ip_vs_app", 0, net->proc_net, &ip_vs_app_fops);
> + proc_net_create("ip_vs_app", 0, net->proc_net, &ip_vs_app_fops);
> return 0;
> }
>
> diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
> index 5ae635a..8250f1d 100644
> --- a/net/netfilter/ipvs/ip_vs_conn.c
> +++ b/net/netfilter/ipvs/ip_vs_conn.c
> @@ -1305,8 +1305,8 @@ int __net_init ip_vs_conn_net_init(struct net *net)
>
> atomic_set(&ipvs->conn_count, 0);
>
> - proc_create("ip_vs_conn", 0, net->proc_net, &ip_vs_conn_fops);
> - proc_create("ip_vs_conn_sync", 0, net->proc_net, &ip_vs_conn_sync_fops);
> + proc_net_create("ip_vs_conn", 0, net->proc_net, &ip_vs_conn_fops);
> + proc_net_create("ip_vs_conn_sync", 0, net->proc_net, &ip_vs_conn_sync_fops);
> return 0;
> }
>
> diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
> index c8e0505..1d21a4b 100644
> --- a/net/netfilter/ipvs/ip_vs_ctl.c
> +++ b/net/netfilter/ipvs/ip_vs_ctl.c
> @@ -3829,9 +3829,9 @@ int __net_init ip_vs_control_net_init(struct net *net)
>
> spin_lock_init(&ipvs->tot_stats.lock);
>
> - proc_create("ip_vs", 0, net->proc_net, &ip_vs_info_fops);
> - proc_create("ip_vs_stats", 0, net->proc_net, &ip_vs_stats_fops);
> - proc_create("ip_vs_stats_percpu", 0, net->proc_net,
> + proc_net_create("ip_vs", 0, net->proc_net, &ip_vs_info_fops);
> + proc_net_create("ip_vs_stats", 0, net->proc_net, &ip_vs_stats_fops);
> + proc_net_create("ip_vs_stats_percpu", 0, net->proc_net,
> &ip_vs_stats_percpu_fops);
>
> if (ip_vs_control_net_init_sysctl(net))
> diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
> index 37b8b33..d72a719 100644
> --- a/net/netfilter/nf_conntrack_expect.c
> +++ b/net/netfilter/nf_conntrack_expect.c
> @@ -595,7 +595,7 @@ static int exp_proc_init(struct net *net)
> #ifdef CONFIG_NF_CONNTRACK_PROCFS
> struct proc_dir_entry *proc;
>
> - proc = proc_create("nf_conntrack_expect", 0440, net->proc_net,
> + proc = proc_net_create("nf_conntrack_expect", 0440, net->proc_net,
> &exp_file_ops);
> if (!proc)
> return -ENOMEM;
> diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
> index 871e6ff..6c4955f 100644
> --- a/net/netfilter/nf_conntrack_standalone.c
> +++ b/net/netfilter/nf_conntrack_standalone.c
> @@ -403,12 +403,12 @@ static int nf_conntrack_standalone_init_proc(struct net *net)
> {
> struct proc_dir_entry *pde;
>
> - pde = proc_create("nf_conntrack", 0440, net->proc_net, &ct_file_ops);
> + pde = proc_net_create("nf_conntrack", 0440, net->proc_net, &ct_file_ops);
> if (!pde)
> goto out_nf_conntrack;
>
> - pde = proc_net_create_data("nf_conntrack", S_IRUGO, net->proc_net_stat,
> - &ct_cpu_seq_fops, NULL);
> + pde = proc_net_create("nf_conntrack", S_IRUGO, net->proc_net_stat,
> + &ct_cpu_seq_fops);
> if (!pde)
> goto out_stat_nf_conntrack;
> return 0;
> diff --git a/net/netfilter/nf_synproxy_core.c b/net/netfilter/nf_synproxy_core.c
> index 8d69ddd..49764d7 100644
> --- a/net/netfilter/nf_synproxy_core.c
> +++ b/net/netfilter/nf_synproxy_core.c
> @@ -325,7 +325,7 @@ static const struct file_operations synproxy_cpu_seq_fops = {
>
> static int __net_init synproxy_proc_init(struct net *net)
> {
> - if (!proc_create("synproxy", S_IRUGO, net->proc_net_stat,
> + if (!proc_net_create("synproxy", S_IRUGO, net->proc_net_stat,
> &synproxy_cpu_seq_fops))
> return -ENOMEM;
> return 0;
> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
> index 1a395b2..b343e40 100644
> --- a/net/netlink/af_netlink.c
> +++ b/net/netlink/af_netlink.c
> @@ -3218,7 +3218,7 @@ static const struct net_proto_family netlink_family_ops = {
> static int __net_init netlink_net_init(struct net *net)
> {
> #ifdef CONFIG_PROC_FS
> - if (!proc_create("netlink", 0, net->proc_net, &netlink_seq_fops))
> + if (!proc_net_create("netlink", 0, net->proc_net, &netlink_seq_fops))
> return -ENOMEM;
> #endif
> return 0;
> diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
> index 8214b9f..517f5a1 100644
> --- a/net/packet/af_packet.c
> +++ b/net/packet/af_packet.c
> @@ -4159,7 +4159,7 @@ static int __net_init packet_net_init(struct net *net)
> mutex_init(&net->packet.sklist_lock);
> INIT_HLIST_HEAD(&net->packet.sklist);
>
> - if (!proc_create("packet", 0, net->proc_net, &packet_seq_fops))
> + if (!proc_net_create("packet", 0, net->proc_net, &packet_seq_fops))
> return -ENOMEM;
>
> return 0;
> diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
> index b71c25b..f2e5dbb 100644
> --- a/net/phonet/pn_dev.c
> +++ b/net/phonet/pn_dev.c
> @@ -320,7 +320,7 @@ static int __net_init phonet_init_net(struct net *net)
> {
> struct phonet_net *pnn = phonet_pernet(net);
>
> - if (!proc_create("phonet", 0, net->proc_net, &pn_sock_seq_fops))
> + if (!proc_net_create("phonet", 0, net->proc_net, &pn_sock_seq_fops))
> return -ENOMEM;
>
> INIT_LIST_HEAD(&pnn->pndevs.list);
> diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
> index d72b992..3043af5 100644
> --- a/net/sched/sch_api.c
> +++ b/net/sched/sch_api.c
> @@ -1872,7 +1872,7 @@ static int __net_init psched_net_init(struct net *net)
> {
> struct proc_dir_entry *e;
>
> - e = proc_create("psched", 0, net->proc_net, &psched_fops);
> + e = proc_net_create("psched", 0, net->proc_net, &psched_fops);
> if (e == NULL)
> return -ENOMEM;
>
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index 6699df7..a157cce 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -2882,7 +2882,7 @@ static int __net_init unix_net_init(struct net *net)
> goto out;
>
> #ifdef CONFIG_PROC_FS
> - if (!proc_create("unix", 0, net->proc_net, &unix_seq_fops)) {
> + if (!proc_net_create("unix", 0, net->proc_net, &unix_seq_fops)) {
> unix_sysctl_unregister(net);
> goto out;
> }
> diff --git a/net/wireless/wext-proc.c b/net/wireless/wext-proc.c
> index e98a01c..9af0f85 100644
> --- a/net/wireless/wext-proc.c
> +++ b/net/wireless/wext-proc.c
> @@ -143,7 +143,7 @@ static const struct file_operations wireless_seq_fops = {
> int __net_init wext_proc_init(struct net *net)
> {
> /* Create /proc/net/wireless entry */
> - if (!proc_create("wireless", S_IRUGO, net->proc_net,
> + if (!proc_net_create("wireless", S_IRUGO, net->proc_net,
> &wireless_seq_fops))
> return -ENOMEM;
>
> diff --git a/net/xfrm/xfrm_proc.c b/net/xfrm/xfrm_proc.c
> index c721b0d..2abc64a 100644
> --- a/net/xfrm/xfrm_proc.c
> +++ b/net/xfrm/xfrm_proc.c
> @@ -74,7 +74,7 @@ static const struct file_operations xfrm_statistics_seq_fops = {
>
> int __net_init xfrm_proc_init(struct net *net)
> {
> - if (!proc_create("xfrm_stat", S_IRUGO, net->proc_net,
> + if (!proc_net_create("xfrm_stat", S_IRUGO, net->proc_net,
> &xfrm_statistics_seq_fops))
> return -ENOMEM;
> return 0;
>
> _______________________________________________
> Devel mailing list
> Devel at openvz.org
> https://lists.openvz.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/devel/attachments/20170721/6463bf84/attachment-0001.html>
More information about the Devel
mailing list