]> err.no Git - linux-2.6/blobdiff - drivers/s390/block/dasd.c
Automatic merge of /spare/repo/linux-2.6/.git branch HEAD
[linux-2.6] / drivers / s390 / block / dasd.c
index b755bac6ccbca7507bcc63f81854ca42dcfa5bbd..ceeb3cf64a16ccc10aa521c550889fc0cad5edcd 100644 (file)
@@ -7,7 +7,7 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.158 $
+ * $Revision: 1.164 $
  */
 
 #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);
@@ -1631,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);
 }
 
 /*
@@ -1761,10 +1766,10 @@ dasd_generic_probe (struct ccw_device *cdev,
                printk(KERN_WARNING
                       "dasd_generic_probe: could not add sysfs entries "
                       "for %s\n", cdev->dev.bus_id);
+       } else {
+               cdev->handler = &dasd_int_handler;
        }
 
-       cdev->handler = &dasd_int_handler;
-
        return ret;
 }
 
@@ -1775,6 +1780,8 @@ dasd_generic_remove (struct ccw_device *cdev)
 {
        struct dasd_device *device;
 
+       cdev->handler = NULL;
+
        dasd_remove_sysfs_files(cdev);
        device = dasd_device_from_cdev(cdev);
        if (IS_ERR(device))
@@ -1803,13 +1810,17 @@ dasd_generic_set_online (struct ccw_device *cdev,
 
 {
        struct dasd_device *device;
-       int rc;
+       int feature_diag, rc;
 
        device = dasd_create_device(cdev);
        if (IS_ERR(device))
                return PTR_ERR(device);
 
-       if (test_bit(DASD_FLAG_USE_DIAG, &device->flags)) {
+       feature_diag = dasd_get_feature(cdev, DASD_FEATURE_USEDIAG);
+       if (feature_diag < 0)
+               return feature_diag;
+
+       if (feature_diag) {
                if (!dasd_diag_discipline_pointer) {
                        printk (KERN_WARNING
                                "dasd_generic couldn't online device %s "