commit 04e90158144ca546b47494eda16800eb6db38ff7 Author: James Bottomley Date: Fri Jan 25 20:05:55 2008 -0600 [SCSI] bsg: copy the cmd_type field to the subordinate request for bidi This fixes a problem in SCSI where we use the (previously uninitialised) cmd_type via blk_pc_request() to set up the transfer in scsi_init_sgtable(). Acked-by: FUJITA Tomonori Signed-off-by: James Bottomley commit 2b28efffd6822e8b83bf9f0021088d08bae0d39f Author: FUJITA Tomonori Date: Fri Jan 25 23:25:14 2008 +0900 [SCSI] handle scsi_init_queue failure properly scsi_init_queue is expected to clean up allocated things when it fails. Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley commit 037adb2b4fd0cb2f488437d94033d38cb664bc01 Author: FUJITA Tomonori Date: Fri Jan 25 23:25:13 2008 +0900 [SCSI] destroy scsi_bidi_sdb_cache in scsi_exit_queue Needs to call kmem_cache_destroy for scsi_bidi_sdb_cache in scsi_exit_queue. Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley commit 57331e7a0364c283ae29a7e66d149b7624b54a52 Author: FUJITA Tomonori Date: Wed Jan 23 01:32:01 2008 +0900 [SCSI] scsi_debug: add XDWRITEREAD_10 support Signed-off-by: FUJITA Tomonori Acked-by: Douglas Gilbert Signed-off-by: James Bottomley commit 32f914249c4fac2fd754a02aac5928d08cb15ac7 Author: FUJITA Tomonori Date: Wed Jan 23 01:32:00 2008 +0900 [SCSI] scsi_debug: add bidi data transfer support This enables fill_from_dev_buffer and fetch_to_dev_buffer to handle bidi commands. Signed-off-by: FUJITA Tomonori Acked-by: Douglas Gilbert Signed-off-by: James Bottomley commit bdc299bfc7ae9432c459e0519f497d8830433608 Author: FUJITA Tomonori Date: Wed Jan 23 01:31:59 2008 +0900 [SCSI] scsi_debug: add get_data_transfer_info helper function This adds get_data_transfer_info helper function that get lha and sectors for READ_* and WRITE_* commands (and XDWRITEREAD_10 later). Signed-off-by: FUJITA Tomonori Acked-by: Douglas Gilbert Signed-off-by: James Bottomley commit 2a55c475c61aaf5483d76335e3831886e247a943 Author: James Bottomley Date: Tue Jan 15 11:11:46 2008 -0600 [SCSI] remove use_sg_chaining With the sg table code, every SCSI driver is now either chain capable or broken (or has sg_tablesize set so chaining is never activated), so there's no need to have a check in the host template. Also tidy up the code by moving the scatterlist size defines into the SCSI includes and permit the last entry of the scatterlist pools not to be a power of two. commit 7b356de4b990b51c21eab30c2e324a0686a2dcae Author: Kiyoshi Ueda Date: Fri Jan 18 12:02:15 2008 -0500 [SCSI] bidirectional: fix up for the new blk_end_request code Signed-off-by: Kiyoshi Ueda Signed-off-by: Jun'ichi Nomura Signed-off-by: James Bottomley commit a228ebf454aa0562850c9998c62bdcb6dea73192 Author: Boaz Harrosh Date: Thu Dec 13 13:50:53 2007 +0200 [SCSI] bidirectional command support At the block level bidi request uses req->next_rq pointer for a second bidi_read request. At Scsi-midlayer a second scsi_data_buffer structure is used for the bidi_read part. This bidi scsi_data_buffer is put on request->next_rq->special. Struct scsi_cmnd is not changed. - Define scsi_bidi_cmnd() to return true if it is a bidi request and a second sgtable was allocated. - Define scsi_in()/scsi_out() to return the in or out scsi_data_buffer from this command This API is to isolate users from the mechanics of bidi. - Define scsi_end_bidi_request() to do what scsi_end_request() does but for a bidi request. This is necessary because bidi commands are a bit tricky here. (See comments in body) - scsi_release_buffers() will also release the bidi_read scsi_data_buffer - scsi_io_completion() on bidi commands will now call scsi_end_bidi_request() and return. - The previous work done in scsi_init_io() is now done in a new scsi_init_sgtable() (which is 99% identical to old scsi_init_io()) The new scsi_init_io() will call the above twice if needed also for the bidi_read command. Only at this point is a command bidi. - In scsi_error.c at scsi_eh_prep/restore_cmnd() make sure bidi-lld is not confused by a get-sense command that looks like bidi. This is done by puting NULL at request->next_rq, and restoring. [jejb: update to sg_table and resolve conflicts also update to blk-end-request and resolve conflicts] Signed-off-by: Boaz Harrosh Signed-off-by: James Bottomley commit d52e9aad6e2f985c97f3687b6ac37c6ef960eb7e Author: Boaz Harrosh Date: Thu Dec 13 13:47:40 2007 +0200 [SCSI] implement scsi_data_buffer In preparation for bidi we abstract all IO members of scsi_cmnd, that will need to duplicate, into a substructure. - Group all IO members of scsi_cmnd into a scsi_data_buffer structure. - Adjust accessors to new members. - scsi_{alloc,free}_sgtable receive a scsi_data_buffer instead of scsi_cmnd. And work on it. - Adjust scsi_init_io() and scsi_release_buffers() for above change. - Fix other parts of scsi_lib/scsi.c to members migration. Use accessors where appropriate. - fix Documentation about scsi_cmnd in scsi_host.h - scsi_error.c * Changed needed members of struct scsi_eh_save. * Careful considerations in scsi_eh_prep/restore_cmnd. - sd.c and sr.c * sd and sr would adjust IO size to align on device's block size so code needs to change once we move to scsi_data_buff implementation. * Convert code to use scsi_for_each_sg * Use data accessors where appropriate. - tgt: convert libsrp to use scsi_data_buffer - isd200: This driver still bangs on scsi_cmnd IO members, so need changing [jejb: rebased on top of sg_table patches fixed up conflicts and used the synergy to eliminate use_sg and sg_count] Signed-off-by: Boaz Harrosh Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley commit 52a6ca1b8688f01aef7d07e21861ebc81db96638 Author: Boaz Harrosh Date: Thu Dec 13 16:14:27 2007 -0800 [SCSI] tgt: use scsi_init_io instead of scsi_alloc_sgtable If we export scsi_init_io()/scsi_release_buffers() instead of scsi_{alloc,free}_sgtable() from scsi_lib than tgt code is much more insulated from scsi_lib changes. As a bonus it will also gain bidi capability when it comes. [jejb: rebase on to sg_table and fix up rejections] Signed-off-by: Boaz Harrosh Acked-by: FUJITA Tomonori Signed-off-by: Andrew Morton Signed-off-by: James Bottomley