Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / s390 / block / dasd_erp.c
index 37fa421..b842377 100644 (file)
@@ -7,7 +7,6 @@
  * Bugreports.to..: <Linux390@de.ibm.com>
  * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
  *
- * $Revision: 1.10 $
  */
 
 #include <linux/config.h>
@@ -33,13 +32,8 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize,
        int size;
 
        /* Sanity checks */
-       if ( magic == NULL || datasize > PAGE_SIZE ||
-            (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
-               BUG();
-       debug_text_event ( dasd_debug_area, 1, "ALLC");
-       debug_text_event ( dasd_debug_area, 1, magic);
-       debug_int_event ( dasd_debug_area, 1, cplength);
-       debug_int_event ( dasd_debug_area, 1, datasize);
+       BUG_ON( magic == NULL || datasize > PAGE_SIZE ||
+            (cplength*sizeof(struct ccw1)) > PAGE_SIZE);
 
        size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
        if (cplength > 0)
@@ -67,7 +61,8 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize,
        }
        strncpy((char *) &cqr->magic, magic, 4);
        ASCEBC((char *) &cqr->magic, 4);
-       atomic_inc(&device->ref_count);
+       set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
+       dasd_get_device(device);
        return cqr;
 }
 
@@ -76,10 +71,6 @@ dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
 {
        unsigned long flags;
 
-       if (cqr->dstat != NULL)
-               kfree(cqr->dstat);
-       debug_text_event(dasd_debug_area, 1, "FREE");
-       debug_int_event(dasd_debug_area, 1, (long) cqr);
        spin_lock_irqsave(&device->mem_lock, flags);
        dasd_free_chunk(&device->erp_chunks, cqr);
        spin_unlock_irqrestore(&device->mem_lock, flags);
@@ -102,11 +93,11 @@ dasd_default_erp_action(struct dasd_ccw_req * cqr)
                 DEV_MESSAGE (KERN_DEBUG, device, 
                              "default ERP called (%i retries left)",
                              cqr->retries);
+               cqr->lpm    = LPM_ANYPATH;
                cqr->status = DASD_CQR_QUEUED;
         } else {
                 DEV_MESSAGE (KERN_WARNING, device, "%s",
                             "default ERP called (NO retry left)");
-               
                cqr->status = DASD_CQR_FAILED;
                cqr->stopclk = get_clock ();
         }
@@ -133,8 +124,7 @@ dasd_default_erp_postaction(struct dasd_ccw_req * cqr)
        struct dasd_device *device;
        int success;
 
-       if (cqr->refers == NULL || cqr->function == NULL)
-               BUG();
+       BUG_ON(cqr->refers == NULL || cqr->function == NULL);
 
        device = cqr->device;
        success = cqr->status == DASD_CQR_DONE;