diff options
author | Denis V. Lunev <den@openvz.org> | 2008-05-02 05:46:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-05-02 05:46:22 -0400 |
commit | 5efdccbcda20d3e5fbaa85f726dcc9cfeb005577 (patch) | |
tree | 7b61603bf422064b69586853093af194009bd231 | |
parent | 6e79d85d9a6b7a149dd3666b079c96cfbf57fdb8 (diff) |
net: assign PDE->data before gluing PDE into /proc tree
Simply replace proc_create and further data assigned with proc_create_data.
Additionally, there is no need to assign NULL to PDE->data after creation,
/proc generic has already done this for us.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/core/neighbour.c | 5 | ||||
-rw-r--r-- | net/core/pktgen.c | 12 |
2 files changed, 6 insertions, 11 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 75075c303c44..5d9d7130bd6e 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1430,11 +1430,10 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl) | |||
1430 | panic("cannot create neighbour cache statistics"); | 1430 | panic("cannot create neighbour cache statistics"); |
1431 | 1431 | ||
1432 | #ifdef CONFIG_PROC_FS | 1432 | #ifdef CONFIG_PROC_FS |
1433 | tbl->pde = proc_create(tbl->id, 0, init_net.proc_net_stat, | 1433 | tbl->pde = proc_create_data(tbl->id, 0, init_net.proc_net_stat, |
1434 | &neigh_stat_seq_fops); | 1434 | &neigh_stat_seq_fops, tbl); |
1435 | if (!tbl->pde) | 1435 | if (!tbl->pde) |
1436 | panic("cannot create neighbour proc dir entry"); | 1436 | panic("cannot create neighbour proc dir entry"); |
1437 | tbl->pde->data = tbl; | ||
1438 | #endif | 1437 | #endif |
1439 | 1438 | ||
1440 | tbl->hash_mask = 1; | 1439 | tbl->hash_mask = 1; |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index a803b442234c..8dca21110493 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -3570,15 +3570,14 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname) | |||
3570 | if (err) | 3570 | if (err) |
3571 | goto out1; | 3571 | goto out1; |
3572 | 3572 | ||
3573 | pkt_dev->entry = proc_create(ifname, 0600, | 3573 | pkt_dev->entry = proc_create_data(ifname, 0600, pg_proc_dir, |
3574 | pg_proc_dir, &pktgen_if_fops); | 3574 | &pktgen_if_fops, pkt_dev); |
3575 | if (!pkt_dev->entry) { | 3575 | if (!pkt_dev->entry) { |
3576 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", | 3576 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", |
3577 | PG_PROC_DIR, ifname); | 3577 | PG_PROC_DIR, ifname); |
3578 | err = -EINVAL; | 3578 | err = -EINVAL; |
3579 | goto out2; | 3579 | goto out2; |
3580 | } | 3580 | } |
3581 | pkt_dev->entry->data = pkt_dev; | ||
3582 | #ifdef CONFIG_XFRM | 3581 | #ifdef CONFIG_XFRM |
3583 | pkt_dev->ipsmode = XFRM_MODE_TRANSPORT; | 3582 | pkt_dev->ipsmode = XFRM_MODE_TRANSPORT; |
3584 | pkt_dev->ipsproto = IPPROTO_ESP; | 3583 | pkt_dev->ipsproto = IPPROTO_ESP; |
@@ -3628,7 +3627,8 @@ static int __init pktgen_create_thread(int cpu) | |||
3628 | kthread_bind(p, cpu); | 3627 | kthread_bind(p, cpu); |
3629 | t->tsk = p; | 3628 | t->tsk = p; |
3630 | 3629 | ||
3631 | pe = proc_create(t->tsk->comm, 0600, pg_proc_dir, &pktgen_thread_fops); | 3630 | pe = proc_create_data(t->tsk->comm, 0600, pg_proc_dir, |
3631 | &pktgen_thread_fops, t); | ||
3632 | if (!pe) { | 3632 | if (!pe) { |
3633 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", | 3633 | printk(KERN_ERR "pktgen: cannot create %s/%s procfs entry.\n", |
3634 | PG_PROC_DIR, t->tsk->comm); | 3634 | PG_PROC_DIR, t->tsk->comm); |
@@ -3638,8 +3638,6 @@ static int __init pktgen_create_thread(int cpu) | |||
3638 | return -EINVAL; | 3638 | return -EINVAL; |
3639 | } | 3639 | } |
3640 | 3640 | ||
3641 | pe->data = t; | ||
3642 | |||
3643 | wake_up_process(p); | 3641 | wake_up_process(p); |
3644 | 3642 | ||
3645 | return 0; | 3643 | return 0; |
@@ -3716,8 +3714,6 @@ static int __init pg_init(void) | |||
3716 | return -EINVAL; | 3714 | return -EINVAL; |
3717 | } | 3715 | } |
3718 | 3716 | ||
3719 | pe->data = NULL; | ||
3720 | |||
3721 | /* Register us to receive netdevice events */ | 3717 | /* Register us to receive netdevice events */ |
3722 | register_netdevice_notifier(&pktgen_notifier_block); | 3718 | register_netdevice_notifier(&pktgen_notifier_block); |
3723 | 3719 | ||