aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_genhd.c
diff options
context:
space:
mode:
authorHorst Hummel <horst.hummel@de.ibm.com>2005-05-01 08:58:59 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 08:58:59 -0700
commitf24acd4503270ed4c842c8fef0b71105285e0a06 (patch)
tree9125df60bf98ddcd8197bf479e8a48d22f51af14 /drivers/s390/block/dasd_genhd.c
parent[PATCH] s390: allow longer debug feature names (diff)
downloadlinux-dev-f24acd4503270ed4c842c8fef0b71105285e0a06.tar.xz
linux-dev-f24acd4503270ed4c842c8fef0b71105285e0a06.zip
[PATCH] s390: dasd readonly attribute
The independent read-only flags in devmap, dasd_device and gendisk are not kept in sync. Use one bit per feature in the dasd driver and keep that bit in sync with the gendisk bit. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/block/dasd_genhd.c')
-rw-r--r--drivers/s390/block/dasd_genhd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c
index 1d52db406b2e..96c49349701f 100644
--- a/drivers/s390/block/dasd_genhd.c
+++ b/drivers/s390/block/dasd_genhd.c
@@ -9,7 +9,7 @@
*
* gendisk related functions for the dasd driver.
*
- * $Revision: 1.48 $
+ * $Revision: 1.50 $
*/
#include <linux/config.h>
@@ -31,12 +31,16 @@ int
dasd_gendisk_alloc(struct dasd_device *device)
{
struct gendisk *gdp;
- int len;
+ int len, feature_ro;
/* Make sure the minor for this device exists. */
if (device->devindex >= DASD_PER_MAJOR)
return -EBUSY;
+ feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY);
+ if (feature_ro < 0)
+ return feature_ro;
+
gdp = alloc_disk(1 << DASD_PARTN_BITS);
if (!gdp)
return -ENOMEM;
@@ -71,7 +75,7 @@ dasd_gendisk_alloc(struct dasd_device *device)
sprintf(gdp->devfs_name, "dasd/%s", device->cdev->dev.bus_id);
- if (test_bit(DASD_FLAG_RO, &device->flags))
+ if (feature_ro)
set_disk_ro(gdp, 1);
gdp->private_data = device;
gdp->queue = device->request_queue;