[PATCH 8/29] proc: use non-racy method for /proc/page_owner creation

Denis V. Lunev
2008-04-08T11:20:46Z

Use proc_create()/proc_create_data() to make sure that ->proc_fops and
->data be setup before gluing PDE to main tree.

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
fs/proc/proc_misc.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 0390844..fbaf067 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -1041,12 +1041,10 @@ void __init proc_misc_init(void)
#ifdef CONFIG_PAGE_OWNER
{
struct proc_dir_entry *entry;
- entry = create_proc_entry("page_owner",
- S_IWUSR | S_IRUGO, NULL);
- if (entry) {
- entry->proc_fops = &proc_page_owner_operations;
+ entry = proc_create("page_owner",
+ S_IWUSR | S_IRUGO, NULL, &proc_page_owner_operations);
+ if (entry)
entry->size = 1024;
- }
}
#endif
}
--
1.5.3.rc5