zfcp_fsf_req_cleanup(new_fsf_req); 
zfcp_fsf_req_free(new_fsf_req); 
zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt){	int retval = SUCCESS;	struct zfcp_fsf_req *new_fsf_req, *old_fsf_req;	struct zfcp_adapter *adapter = (struct zfcp_adapter *) scpnt->device->host->hostdata[0];	struct zfcp_unit *unit = (struct zfcp_unit *) scpnt->device->hostdata;	struct zfcp_port *port = unit->port;	struct Scsi_Host *scsi_host = scpnt->device->host;	union zfcp_req_data *req_data = NULL;	unsigned long flags;	u32 status = 0;	/* the components of a abort_dbf record (fixed size record) */	u64 dbf_scsi_cmnd = (unsigned long) scpnt;	char dbf_opcode[ZFCP_ABORT_DBF_LENGTH];	wwn_t dbf_wwn = port->wwpn;	fcp_lun_t dbf_fcp_lun = unit->fcp_lun;	u64 dbf_retries = scpnt->retries;	u64 dbf_allowed = scpnt->allowed;	u64 dbf_timeout = 0;	u64 dbf_fsf_req = 0;	u64 dbf_fsf_status = 0;	u64 dbf_fsf_qual[2] = { 0, 0 };	char dbf_result[ZFCP_ABORT_DBF_LENGTH] = "##undef";	memset(dbf_opcode, 0, ZFCP_ABORT_DBF_LENGTH);	memcpy(dbf_opcode,	       scpnt->cmnd,	       min(scpnt->cmd_len, (unsigned char) ZFCP_ABORT_DBF_LENGTH));	ZFCP_LOG_INFO("aborting scsi_cmnd=%p on adapter %s\n",		      scpnt, zfcp_get_busid_by_adapter(adapter));	spin_unlock_irq(scsi_host->host_lock);	/*	 * Race condition between normal (late) completion and abort has	 * to be avoided.	 * The entirity of all accesses to scsi_req have to be atomic.	 * scsi_req is usually part of the fsf_req and thus we block the	 * release of fsf_req as long as we need to access scsi_req.	 */	write_lock_irqsave(&adapter->abort_lock, flags);	/*	 * Check whether command has just completed and can not be aborted.	 * Even if the command has just been completed late, we can access	 * scpnt since the SCSI stack does not release it at least until	 * this routine returns. (scpnt is parameter passed to this routine	 * and must not disappear during abort even on late completion.)	 */	req_data = (union zfcp_req_data *) scpnt->host_scribble;	/* DEBUG */	ZFCP_LOG_DEBUG("req_data=%p\n", req_data);	if (!req_data) {		ZFCP_LOG_DEBUG("late command completion overtook abort\n");		/*		 * That's it.		 * Do not initiate abort but return SUCCESS.		 */		write_unlock_irqrestore(&adapter->abort_lock, flags);		retval = SUCCESS;		strncpy(dbf_result, "##late1", ZFCP_ABORT_DBF_LENGTH);		goto out;	}	/* Figure out which fsf_req needs to be aborted. */	old_fsf_req = req_data->send_fcp_command_task.fsf_req;	dbf_fsf_req = (unsigned long) old_fsf_req;	dbf_timeout =	    (jiffies - req_data->send_fcp_command_task.start_jiffies) / HZ;	ZFCP_LOG_DEBUG("old_fsf_req=%p\n", old_fsf_req);	if (!old_fsf_req) {		write_unlock_irqrestore(&adapter->abort_lock, flags);		ZFCP_LOG_NORMAL("bug: no old fsf request found\n");		ZFCP_LOG_NORMAL("req_data:\n");		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,			      (char *) req_data, sizeof (union zfcp_req_data));		ZFCP_LOG_NORMAL("scsi_cmnd:\n");		ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_NORMAL,			      (char *) scpnt, sizeof (struct scsi_cmnd));		retval = FAILED;		strncpy(dbf_result, "##bug:r", ZFCP_ABORT_DBF_LENGTH);		goto out;	}	old_fsf_req->data.send_fcp_command_task.scsi_cmnd = NULL;	/* mark old request as being aborted */	old_fsf_req->status |= ZFCP_STATUS_FSFREQ_ABORTING;	/*	 * We have to collect all information (e.g. unit) needed by 	 * zfcp_fsf_abort_fcp_command before calling that routine	 * since that routine is not allowed to access	 * fsf_req which it is going to abort.	 * This is because of we need to release fsf_req_list_lock	 * before calling zfcp_fsf_abort_fcp_command.	 * Since this lock will not be held, fsf_req may complete	 * late and may be released meanwhile.	 */	ZFCP_LOG_DEBUG("unit 0x%016Lx (%p)\n", unit->fcp_lun, unit);	/*	 * We block (call schedule)	 * That's why we must release the lock and enable the	 * interrupts before.	 * On the other hand we do not need the lock anymore since	 * all critical accesses to scsi_req are done.	 */	write_unlock_irqrestore(&adapter->abort_lock, flags);	/* call FSF routine which does the abort */	new_fsf_req = zfcp_fsf_abort_fcp_command((unsigned long) old_fsf_req,						 adapter, unit, 0);	ZFCP_LOG_DEBUG("new_fsf_req=%p\n", new_fsf_req);	if (!new_fsf_req) {		retval = FAILED;		ZFCP_LOG_NORMAL("error: initiation of Abort FCP Cmnd "				"failed\n");		strncpy(dbf_result, "##nores", ZFCP_ABORT_DBF_LENGTH);		goto out;	}	/* wait for completion of abort */	ZFCP_LOG_DEBUG("waiting for cleanup...\n");#if 1	/*	 * FIXME:	 * copying zfcp_fsf_req_wait_and_cleanup code is not really nice	 */	__wait_event(new_fsf_req->completion_wq,		     new_fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED);	status = new_fsf_req->status;	dbf_fsf_status = new_fsf_req->qtcb->header.fsf_status;	/*	 * Ralphs special debug load provides timestamps in the FSF	 * status qualifier. This might be specified later if being	 * useful for debugging aborts.	 */	dbf_fsf_qual[0] =	    *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[0];	dbf_fsf_qual[1] =	    *(u64 *) & new_fsf_req->qtcb->header.fsf_status_qual.word[2];	zfcp_fsf_req_cleanup(new_fsf_req);#else	retval = zfcp_fsf_req_wait_and_cleanup(new_fsf_req,					       ZFCP_UNINTERRUPTIBLE, &status);#endif	ZFCP_LOG_DEBUG("Waiting for cleanup complete, status=0x%x\n", status);	/* status should be valid since signals were not permitted */	if (status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) {		retval = SUCCESS;		strncpy(dbf_result, "##succ", ZFCP_ABORT_DBF_LENGTH);	} else if (status & ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED) {		retval = SUCCESS;		strncpy(dbf_result, "##late2", ZFCP_ABORT_DBF_LENGTH);	} else {		retval = FAILED;		strncpy(dbf_result, "##fail", ZFCP_ABORT_DBF_LENGTH);	} out:	debug_event(adapter->abort_dbf, 1, &dbf_scsi_cmnd, sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_opcode, ZFCP_ABORT_DBF_LENGTH);	debug_event(adapter->abort_dbf, 1, &dbf_wwn, sizeof (wwn_t));	debug_event(adapter->abort_dbf, 1, &dbf_fcp_lun, sizeof (fcp_lun_t));	debug_event(adapter->abort_dbf, 1, &dbf_retries, sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_allowed, sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_timeout, sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_fsf_req, sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_fsf_status, sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_fsf_qual[0], sizeof (u64));	debug_event(adapter->abort_dbf, 1, &dbf_fsf_qual[1], sizeof (u64));	debug_text_event(adapter->abort_dbf, 1, dbf_result);	spin_lock_irq(scsi_host->host_lock);	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1db2c9c0931a53fe013db55fd2ff58859db31e8d/zfcp_scsi.c/clean/drivers/s390/scsi/zfcp_scsi.c