diff options
author | Horst Hummel <horst.hummel@de.ibm.com> | 2005-05-01 11:58:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:58:59 -0400 |
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 b755bac6ccbc..826fd238034d 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Bugreports.to..: <Linux390@de.ibm.com> | 7 | * Bugreports.to..: <Linux390@de.ibm.com> |
8 | * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 | 8 | * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 |
9 | * | 9 | * |
10 | * $Revision: 1.158 $ | 10 | * $Revision: 1.161 $ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
@@ -1131,13 +1131,17 @@ __dasd_process_blk_queue(struct dasd_device * device) | |||
1131 | request_queue_t *queue; | 1131 | request_queue_t *queue; |
1132 | struct request *req; | 1132 | struct request *req; |
1133 | struct dasd_ccw_req *cqr; | 1133 | struct dasd_ccw_req *cqr; |
1134 | int nr_queued; | 1134 | int nr_queued, feature_ro; |
1135 | 1135 | ||
1136 | queue = device->request_queue; | 1136 | queue = device->request_queue; |
1137 | /* No queue ? Then there is nothing to do. */ | 1137 | /* No queue ? Then there is nothing to do. */ |
1138 | if (queue == NULL) | 1138 | if (queue == NULL) |
1139 | return; | 1139 | return; |
1140 | 1140 | ||
1141 | feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); | ||
1142 | if (feature_ro < 0) /* no devmap */ | ||
1143 | return; | ||
1144 | |||
1141 | /* | 1145 | /* |
1142 | * We requeue request from the block device queue to the ccw | 1146 | * We requeue request from the block device queue to the ccw |
1143 | * queue only in two states. In state DASD_STATE_READY the | 1147 | * queue only in two states. In state DASD_STATE_READY the |
@@ -1157,8 +1161,8 @@ __dasd_process_blk_queue(struct dasd_device * device) | |||
1157 | elv_next_request(queue) && | 1161 | elv_next_request(queue) && |
1158 | nr_queued < DASD_CHANQ_MAX_SIZE) { | 1162 | nr_queued < DASD_CHANQ_MAX_SIZE) { |
1159 | req = elv_next_request(queue); | 1163 | req = elv_next_request(queue); |
1160 | if (test_bit(DASD_FLAG_RO, &device->flags) && | 1164 | |
1161 | rq_data_dir(req) == WRITE) { | 1165 | if (feature_ro && rq_data_dir(req) == WRITE) { |
1162 | DBF_DEV_EVENT(DBF_ERR, device, | 1166 | DBF_DEV_EVENT(DBF_ERR, device, |
1163 | "Rejecting write request %p", | 1167 | "Rejecting write request %p", |
1164 | req); | 1168 | req); |
@@ -1803,13 +1807,17 @@ dasd_generic_set_online (struct ccw_device *cdev, | |||
1803 | 1807 | ||
1804 | { | 1808 | { |
1805 | struct dasd_device *device; | 1809 | struct dasd_device *device; |
1806 | int rc; | 1810 | int feature_diag, rc; |
1811 | |||
1812 | feature_diag = dasd_get_feature(cdev, DASD_FEATURE_USEDIAG); | ||
1813 | if (feature_diag < 0) | ||
1814 | return feature_diag; | ||
1807 | 1815 | ||
1808 | device = dasd_create_device(cdev); | 1816 | device = dasd_create_device(cdev); |
1809 | if (IS_ERR(device)) | 1817 | if (IS_ERR(device)) |
1810 | return PTR_ERR(device); | 1818 | return PTR_ERR(device); |
1811 | 1819 | ||
1812 | if (test_bit(DASD_FLAG_USE_DIAG, &device->flags)) { | 1820 | if (feature_diag) { |
1813 | if (!dasd_diag_discipline_pointer) { | 1821 | if (!dasd_diag_discipline_pointer) { |
1814 | printk (KERN_WARNING | 1822 | printk (KERN_WARNING |
1815 | "dasd_generic couldn't online device %s " | 1823 | "dasd_generic couldn't online device %s " |