[SCSI] always handle REQ_BLOCK_PC requests in common code
LLDDs should never see REQ_BLOCK_PC requests, we can handle them just fine in the core code. There is a small behaviour change in that some check in sr's rw_intr are bypassed, but I consider the old behaviour a bug. Mike found this cleanup opportunity and provdided early patches, so all the credit goes to him, even if I redid the patches from scratch beause that was easier than forward-porting the old patches. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
committed by
James Bottomley
parent
d405423992
commit
776b23a036
@@ -238,8 +238,6 @@ static void rw_intr(struct scsi_cmnd * SCpnt)
|
||||
case ILLEGAL_REQUEST:
|
||||
if (!(SCpnt->sense_buffer[0] & 0x90))
|
||||
break;
|
||||
if (!blk_fs_request(SCpnt->request))
|
||||
break;
|
||||
error_sector = (SCpnt->sense_buffer[3] << 24) |
|
||||
(SCpnt->sense_buffer[4] << 16) |
|
||||
(SCpnt->sense_buffer[5] << 8) |
|
||||
@@ -317,23 +315,6 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* these are already setup, just copy cdb basically
|
||||
*/
|
||||
if (SCpnt->request->flags & REQ_BLOCK_PC) {
|
||||
scsi_setup_blk_pc_cmnd(SCpnt);
|
||||
|
||||
if (SCpnt->timeout_per_command)
|
||||
timeout = SCpnt->timeout_per_command;
|
||||
|
||||
goto queue;
|
||||
}
|
||||
|
||||
if (!(SCpnt->request->flags & REQ_CMD)) {
|
||||
blk_dump_rq_flags(SCpnt->request, "sr unsup command");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* we do lazy blocksize switching (when reading XA sectors,
|
||||
* see CDROMREADMODE2 ioctl)
|
||||
@@ -422,8 +403,6 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
|
||||
*/
|
||||
SCpnt->transfersize = cd->device->sector_size;
|
||||
SCpnt->underflow = this_count << 9;
|
||||
|
||||
queue:
|
||||
SCpnt->allowed = MAX_RETRIES;
|
||||
SCpnt->timeout_per_command = timeout;
|
||||
|
||||
|
Reference in New Issue
Block a user