diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:20 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:21 -0400 |
commit | 8b594007c381b01464358bc4b89bfb85ec7f076a (patch) | |
tree | 0536adf6d4d4290106866a8f84568e691ab45697 /drivers/s390/char/tape_proc.c | |
parent | cdefa185dda6b2b267f088a7477e96d845bdc6c1 (diff) |
s390: use non-racy method for proc entries creation
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
main tree.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/s390/char/tape_proc.c')
-rw-r--r-- | drivers/s390/char/tape_proc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c index 0c39636b2174..e7c888c14e71 100644 --- a/drivers/s390/char/tape_proc.c +++ b/drivers/s390/char/tape_proc.c | |||
@@ -111,6 +111,7 @@ static int tape_proc_open(struct inode *inode, struct file *file) | |||
111 | 111 | ||
112 | static const struct file_operations tape_proc_ops = | 112 | static const struct file_operations tape_proc_ops = |
113 | { | 113 | { |
114 | .owner = THIS_MODULE, | ||
114 | .open = tape_proc_open, | 115 | .open = tape_proc_open, |
115 | .read = seq_read, | 116 | .read = seq_read, |
116 | .llseek = seq_lseek, | 117 | .llseek = seq_lseek, |
@@ -124,14 +125,12 @@ void | |||
124 | tape_proc_init(void) | 125 | tape_proc_init(void) |
125 | { | 126 | { |
126 | tape_proc_devices = | 127 | tape_proc_devices = |
127 | create_proc_entry ("tapedevices", S_IFREG | S_IRUGO | S_IWUSR, | 128 | proc_create("tapedevices", S_IFREG | S_IRUGO | S_IWUSR, NULL, |
128 | NULL); | 129 | &tape_proc_ops); |
129 | if (tape_proc_devices == NULL) { | 130 | if (tape_proc_devices == NULL) { |
130 | PRINT_WARN("tape: Cannot register procfs entry tapedevices\n"); | 131 | PRINT_WARN("tape: Cannot register procfs entry tapedevices\n"); |
131 | return; | 132 | return; |
132 | } | 133 | } |
133 | tape_proc_devices->proc_fops = &tape_proc_ops; | ||
134 | tape_proc_devices->owner = THIS_MODULE; | ||
135 | } | 134 | } |
136 | 135 | ||
137 | /* | 136 | /* |