[PATCH 8/29] proc: use non-racy method for /proc/page_owner creation
From: Denis V. Lunev
Date: Tue Apr 08 2008 - 07:20:47 EST
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@xxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/