cmd->state = SCSI_STATE_FINISHED;  
void scsi_finish_command(struct scsi_cmnd *cmd){	struct scsi_device *sdev = cmd->device;	struct Scsi_Host *shost = sdev->host;	struct scsi_request *sreq;	scsi_device_unbusy(sdev);        /*         * Clear the flags which say that the device/host is no longer         * capable of accepting new commands.  These are set in scsi_queue.c         * for both the queue full condition on a device, and for a         * host full condition on the host.	 *	 * XXX(hch): What about locking?         */        shost->host_blocked = 0;        sdev->device_blocked = 0;	/*	 * If we have valid sense information, then some kind of recovery	 * must have taken place.  Make a note of this.	 */	if (SCSI_SENSE_VALID(cmd))		cmd->result |= (DRIVER_SENSE << 24);	SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion "				"for device %d %x\n", sdev->id, cmd->result));	cmd->state = SCSI_STATE_FINISHED;	/*	 * We can get here with use_sg=0, causing a panic in the upper level	 */	cmd->use_sg = cmd->old_use_sg;	/*	 * If there is an associated request structure, copy the data over	 * before we call the completion function.	 */	sreq = cmd->sc_request;	if (sreq) {	       sreq->sr_result = sreq->sr_command->result;	       if (sreq->sr_result) {		       memcpy(sreq->sr_sense_buffer,			      sreq->sr_command->sense_buffer,			      sizeof(sreq->sr_sense_buffer));	       }	}	cmd->done(cmd);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/8d115f845a0bd59cd263e791f739964f42b7b0e8/scsi.c/clean/drivers/scsi/scsi.c