From f24acd4503270ed4c842c8fef0b71105285e0a06 Mon Sep 17 00:00:00 2001 From: Horst Hummel Date: Sun, 1 May 2005 08:58:59 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'drivers/s390/block/dasd.c') 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 @@ * Bugreports.to..: * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * - * $Revision: 1.158 $ + * $Revision: 1.161 $ */ #include @@ -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 " -- cgit v1.2.3-59-g8ed1b From 6ed93c827eea181d87ce078cd1d671128c030b5a Mon Sep 17 00:00:00 2001 From: Stefan Weinhuber Date: Sun, 1 May 2005 08:58:59 -0700 Subject: [PATCH] s390: enable write barriers in the dasd driver The DASD device driver never reorders the I/O requests and relies on the hardware to write all data to nonvolatile storage before signaling a successful write. Hence, the only thing we have to do to support write barriers is to set the queue ordered flag. Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/s390/block/dasd.c') diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 826fd238034d..02cfe244e069 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -1635,6 +1635,7 @@ dasd_setup_queue(struct dasd_device * device) blk_queue_max_hw_segments(device->request_queue, -1L); blk_queue_max_segment_size(device->request_queue, -1L); blk_queue_segment_boundary(device->request_queue, -1L); + blk_queue_ordered(device->request_queue, 1); } /* -- cgit v1.2.3-59-g8ed1b