X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fs390%2Fblock%2Fdasd_erp.c;h=b842377cb0c6c51fa562ba364d4bcab4b2a0d07e;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=37fa4214f94a3a5e31d370b2d5354ec515f32060;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/s390/block/dasd_erp.c b/drivers/s390/block/dasd_erp.c index 37fa4214f..b842377cb 100644 --- a/drivers/s390/block/dasd_erp.c +++ b/drivers/s390/block/dasd_erp.c @@ -7,7 +7,6 @@ * Bugreports.to..: * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * - * $Revision: 1.10 $ */ #include @@ -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;