X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fs390%2Fblock%2Fdasd_proc.c;h=bfa010f6dab25275223d7c6fde5e6e753883fa73;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=353d41118c62916b659cbf065c3894f2c86185c5;hpb=6a77f38946aaee1cd85eeec6cf4229b204c15071;p=linux-2.6.git diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 353d41118..bfa010f6d 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -9,13 +9,12 @@ * * /proc interface for the dasd driver. * - * $Revision: 1.30 $ */ -#include #include #include #include +#include #include #include @@ -77,7 +76,7 @@ dasd_devices_show(struct seq_file *m, void *v) else seq_printf(m, " is ????????"); /* Print devices features. */ - substr = test_bit(DASD_FLAG_RO, &device->flags) ? "(ro)" : " "; + substr = (device->features & DASD_FEATURE_READONLY) ? "(ro)" : " "; seq_printf(m, "%4s: ", substr); /* Print device status information. */ switch ((device != NULL) ? device->state : -1) { @@ -93,6 +92,9 @@ dasd_devices_show(struct seq_file *m, void *v) case DASD_STATE_BASIC: seq_printf(m, "basic"); break; + case DASD_STATE_UNFMT: + seq_printf(m, "unformatted"); + break; case DASD_STATE_READY: case DASD_STATE_ONLINE: seq_printf(m, "active "); @@ -291,23 +293,40 @@ out_error: #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