Files
linux/drivers
Christoph Hellwig 3b00315799 [SCSI] untangle scsi_prep_fn
I wanted to add some BUG checks to scsi_prep_fn to make sure no one
sends us a non-sg command, but this function is a horrible mess.

So I decided to detangle the function and document what the valid
cases are.  While doing that I found that REQ_TYPE_SPECIAL commands
aren't used by the SCSI layer anymore and we can get rid of the code
handling them.

The new structure of scsi_prep_fn is:

 (1) check if we're allowed to send this command
 (2) big switch on cmd_type.  For the two valid types call into
     a function to set the command up, else error
 (3) code to handle error cases

Because FS and BLOCK_PC commands are handled entirely separate after
the patch this introduces a tiny amount of code duplication.  This
improves readabiulity though and will help to avoid the bidi command
overhead for FS commands so it's a good thing.

I've tested this on both sata and mptsas.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2006-11-15 14:14:20 -06:00
..
…
2006-10-10 15:37:23 -07:00
…
…
…
2006-10-10 15:37:23 -07:00
2006-10-08 12:32:35 -07:00
2006-10-03 22:31:37 +02:00
2006-10-10 15:37:24 -07:00
2006-11-15 14:14:20 -06:00
…
2006-10-10 15:37:21 -07:00
2006-10-03 22:31:37 +02:00
…
…