aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:21 -0400
commit8b594007c381b01464358bc4b89bfb85ec7f076a (patch)
tree0536adf6d4d4290106866a8f84568e691ab45697 /drivers/s390/block
parentcdefa185dda6b2b267f088a7477e96d845bdc6c1 (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/block')
-rw-r--r--drivers/s390/block/dasd_proc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 8ae9406b10ad..03c0e40a92ff 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -157,6 +157,7 @@ static int dasd_devices_open(struct inode *inode, struct file *file)
157} 157}
158 158
159static const struct file_operations dasd_devices_file_ops = { 159static const struct file_operations dasd_devices_file_ops = {
160 .owner = THIS_MODULE,
160 .open = dasd_devices_open, 161 .open = dasd_devices_open,
161 .read = seq_read, 162 .read = seq_read,
162 .llseek = seq_lseek, 163 .llseek = seq_lseek,
@@ -315,13 +316,12 @@ dasd_proc_init(void)
315 if (!dasd_proc_root_entry) 316 if (!dasd_proc_root_entry)
316 goto out_nodasd; 317 goto out_nodasd;
317 dasd_proc_root_entry->owner = THIS_MODULE; 318 dasd_proc_root_entry->owner = THIS_MODULE;
318 dasd_devices_entry = create_proc_entry("devices", 319 dasd_devices_entry = proc_create("devices",
319 S_IFREG | S_IRUGO | S_IWUSR, 320 S_IFREG | S_IRUGO | S_IWUSR,
320 dasd_proc_root_entry); 321 dasd_proc_root_entry,
322 &dasd_devices_file_ops);
321 if (!dasd_devices_entry) 323 if (!dasd_devices_entry)
322 goto out_nodevices; 324 goto out_nodevices;
323 dasd_devices_entry->proc_fops = &dasd_devices_file_ops;
324 dasd_devices_entry->owner = THIS_MODULE;
325 dasd_statistics_entry = create_proc_entry("statistics", 325 dasd_statistics_entry = create_proc_entry("statistics",
326 S_IFREG | S_IRUGO | S_IWUSR, 326 S_IFREG | S_IRUGO | S_IWUSR,
327 dasd_proc_root_entry); 327 dasd_proc_root_entry);