From 8193a8dd81077bcb8c27617084800c8ad4397638 Mon Sep 17 00:00:00 2001 From: Horst Hummel Date: Mon, 10 Apr 2006 22:53:48 -0700 Subject: [PATCH] --- yaml --- r: 25487 b: refs/heads/master c: 7220fe8b7915af4ffcd42d73c285c5898734d087 h: refs/heads/master i: 25485: 878fe26f8761a3fcd3e86c32a9aa40fa18382072 25483: 2214fec1dc29f64dd09a466026d780d1ccad9454 25479: 3e131b6def48e830e9137f7cf5609a81da5526d3 25471: 7f3839ed8b2106ec947426a34adde3f4eddabacd v: v3 --- [refs] | 2 +- trunk/drivers/s390/block/dasd_proc.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index eaa94366b7d3..c6967a98ac67 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 25ee4cf831fcc2855927c175d246a25e5ebe5902 +refs/heads/master: 7220fe8b7915af4ffcd42d73c285c5898734d087 diff --git a/trunk/drivers/s390/block/dasd_proc.c b/trunk/drivers/s390/block/dasd_proc.c index 1aa3c261718a..ad23aede356c 100644 --- a/trunk/drivers/s390/block/dasd_proc.c +++ b/trunk/drivers/s390/block/dasd_proc.c @@ -294,23 +294,40 @@ dasd_statistics_write(struct file *file, const char __user *user_buf, #endif /* CONFIG_DASD_PROFILE */ } +/* + * Create dasd proc-fs entries. + * In case creation failed, cleanup and return -ENOENT. + */ int dasd_proc_init(void) { dasd_proc_root_entry = proc_mkdir("dasd", &proc_root); + if (!dasd_proc_root_entry) + goto out_nodasd; dasd_proc_root_entry->owner = THIS_MODULE; dasd_devices_entry = create_proc_entry("devices", S_IFREG | S_IRUGO | S_IWUSR, dasd_proc_root_entry); + if (!dasd_devices_entry) + goto out_nodevices; dasd_devices_entry->proc_fops = &dasd_devices_file_ops; dasd_devices_entry->owner = THIS_MODULE; dasd_statistics_entry = create_proc_entry("statistics", S_IFREG | S_IRUGO | S_IWUSR, dasd_proc_root_entry); + if (!dasd_statistics_entry) + goto out_nostatistics; dasd_statistics_entry->read_proc = dasd_statistics_read; dasd_statistics_entry->write_proc = dasd_statistics_write; dasd_statistics_entry->owner = THIS_MODULE; return 0; + + out_nostatistics: + remove_proc_entry("devices", dasd_proc_root_entry); + out_nodevices: + remove_proc_entry("dasd", &proc_root); + out_nodasd: + return -ENOENT; } void