Commit 19b4fc52 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by Linus Torvalds

reiserfs: use non-racy method for proc entries creation

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

/proc entry owner is also added.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <chris.mason@oracle.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 46fe74f2
...@@ -467,6 +467,7 @@ static const struct file_operations r_file_operations = { ...@@ -467,6 +467,7 @@ static const struct file_operations r_file_operations = {
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = seq_release, .release = seq_release,
.owner = THIS_MODULE,
}; };
static struct proc_dir_entry *proc_info_root = NULL; static struct proc_dir_entry *proc_info_root = NULL;
...@@ -475,12 +476,8 @@ static const char proc_info_root_name[] = "fs/reiserfs"; ...@@ -475,12 +476,8 @@ static const char proc_info_root_name[] = "fs/reiserfs";
static void add_file(struct super_block *sb, char *name, static void add_file(struct super_block *sb, char *name,
int (*func) (struct seq_file *, struct super_block *)) int (*func) (struct seq_file *, struct super_block *))
{ {
struct proc_dir_entry *de; proc_create_data(name, 0, REISERFS_SB(sb)->procdir,
de = create_proc_entry(name, 0, REISERFS_SB(sb)->procdir); &r_file_operations, func);
if (de) {
de->data = func;
de->proc_fops = &r_file_operations;
}
} }
int reiserfs_proc_info_init(struct super_block *sb) int reiserfs_proc_info_init(struct super_block *sb)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment