From: Christoph Hellwig Date: Sat, 4 Nov 2006 19:10:55 +0000 (+0100) Subject: [SCSI] untangle scsi_prep_fn X-Git-Tag: v2.6.20-rc1~34^2~20^2~41^2~66 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b00315799d78f76531b71435fbc2643cd71ae4c;p=pandora-kernel.git [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 Signed-off-by: James Bottomley --- Reading git-diff-tree failed