(STp->buffer)->last_SRpnt->sr_request->waiting = NULL; 
SRpnt = STbuffer->last_SRpnt; STbuffer->last_SRpnt = NULL; SRpnt->sr_request->waiting = NULL; if (SRpnt->sr_request->rq_status != RQ_SCSI_DONE) SRpnt->sr_result |= (DRIVER_ERROR << 24); 
static int write_behind_check(struct scsi_tape * STp){	int retval = 0;	struct st_buffer *STbuffer;	struct st_partstat *STps;	struct st_cmdstatus *cmdstatp;	STbuffer = STp->buffer;	if (!STbuffer->writing)		return 0;        DEB(	if (STp->write_pending)		STp->nbr_waits++;	else		STp->nbr_finished++;        ) /* end DEB */	wait_for_completion(&(STp->wait));	(STp->buffer)->last_SRpnt->sr_request->waiting = NULL;	(STp->buffer)->syscall_result = st_chk_result(STp, (STp->buffer)->last_SRpnt);	scsi_release_request((STp->buffer)->last_SRpnt);	STbuffer->buffer_bytes -= STbuffer->writing;	STps = &(STp->ps[STp->partition]);	if (STps->drv_block >= 0) {		if (STp->block_size == 0)			STps->drv_block++;		else			STps->drv_block += STbuffer->writing / STp->block_size;	}	cmdstatp = &STbuffer->cmdstat;	if (STbuffer->syscall_result) {		retval = -EIO;		if (cmdstatp->have_sense && !cmdstatp->deferred &&		    (cmdstatp->flags & SENSE_EOM) &&		    (cmdstatp->sense_hdr.sense_key == NO_SENSE ||		     cmdstatp->sense_hdr.sense_key == RECOVERED_ERROR)) {			/* EOM at write-behind, has all data been written? */			if (!cmdstatp->remainder_valid ||			    cmdstatp->uremainder64 == 0)				retval = -ENOSPC;		}		if (retval == -EIO)			STps->drv_block = -1;	}	STbuffer->writing = 0;	DEB(if (debugging && retval)	    printk(ST_DEB_MSG "%s: Async write error %x, return value %d.\n",		   tape_name(STp), STbuffer->cmdstat.midlevel_result, retval);) /* end DEB */	return retval;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/f03a567054fea4f9d43c50ec91338266c0bd588d/st.c/clean/drivers/scsi/st.c