diff options
author | Horst Hummel <horst.hummel@de.ibm.com> | 2005-05-01 08:58:59 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 08:58:59 -0700 |
commit | f24acd4503270ed4c842c8fef0b71105285e0a06 (patch) | |
tree | 9125df60bf98ddcd8197bf479e8a48d22f51af14 /drivers/s390/block/dasd.c | |
parent | e8f0641ef74eaa71ed9aa9d19c4b741c2143d752 (diff) |
[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.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index b755bac6ccb..826fd238034 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -7,7 +7,7 @@ * Bugreports.to..: <Linux390@de.ibm.com> * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * - * $Revision: 1.158 $ + * $Revision: 1.161 $ */ #include <linux/config.h> @@ -1131,13 +1131,17 @@ __dasd_process_blk_queue(struct dasd_device * device) request_queue_t *queue; struct request *req; struct dasd_ccw_req *cqr; - int nr_queued; + int nr_queued, feature_ro; queue = device->request_queue; /* No queue ? Then there is nothing to do. */ if (queue == NULL) return; + feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); + if (feature_ro < 0) /* no devmap */ + return; + /* * We requeue request from the block device queue to the ccw * queue only in two states. In state DASD_STATE_READY the @@ -1157,8 +1161,8 @@ __dasd_process_blk_queue(struct dasd_device * device) elv_next_request(queue) && nr_queued < DASD_CHANQ_MAX_SIZE) { req = elv_next_request(queue); - if (test_bit(DASD_FLAG_RO, &device->flags) && - rq_data_dir(req) == WRITE) { + + if (feature_ro && rq_data_dir(req) == WRITE) { DBF_DEV_EVENT(DBF_ERR, device, "Rejecting write request %p", req); @@ -1803,13 +1807,17 @@ dasd_generic_set_online (struct ccw_device *cdev, { struct dasd_device *device; - int rc; + int feature_diag, rc; + + feature_diag = dasd_get_feature(cdev, DASD_FEATURE_USEDIAG); + if (feature_diag < 0) + return feature_diag; device = dasd_create_device(cdev); if (IS_ERR(device)) return PTR_ERR(device); - if (test_bit(DASD_FLAG_USE_DIAG, &device->flags)) { + if (feature_diag) { if (!dasd_diag_discipline_pointer) { printk (KERN_WARNING "dasd_generic couldn't online device %s " |