Re: [PATCH scsi] Short the path length of scsi_cmd_to_driver()

2012-09-28 Thread James Bottomley
On Thu, 2012-09-27 at 13:43 -0400, Martin K. Petersen wrote: > > "Li" == Li Zhong writes: > > > @@ -845,8 +844,11 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, > > unsigned char *cmnd, > > > > scsi_eh_restore_cmnd(scmd, &ses); > > > >-if (sdrv && sdrv->eh_action) > >-

Re: [PATCH scsi] Short the path length of scsi_cmd_to_driver()

2012-09-28 Thread Li Zhong
On Thu, 2012-09-27 at 13:43 -0400, Martin K. Petersen wrote: > > "Li" == Li Zhong writes: > > > @@ -845,8 +844,11 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, > > unsigned char *cmnd, > > > > scsi_eh_restore_cmnd(scmd, &ses); > > > >-if (sdrv && sdrv->eh_action) > >-

Re: [PATCH scsi] Short the path length of scsi_cmd_to_driver()

2012-09-27 Thread Martin K. Petersen
> "Li" == Li Zhong writes: > @@ -845,8 +844,11 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, > unsigned char *cmnd, > > scsi_eh_restore_cmnd(scmd, &ses); > >- if (sdrv && sdrv->eh_action) >- rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn); >+ if (sc

[PATCH scsi] Short the path length of scsi_cmd_to_driver()

2012-09-27 Thread Li Zhong
Hi James, Martin, Here is the updated version, please help to review. Thanks, Zhong As suggested by James: this patch tries to short the path length of scsi_cmd_to_driver(). As only REQ_TYPE_BLOCK_PC commands can be submitted without a driver, so we could avoid the related NULL check