1. 12 7月, 2008 9 次提交
  2. 05 6月, 2008 1 次提交
  3. 03 5月, 2008 1 次提交
  4. 02 5月, 2008 1 次提交
    • B
      [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer · 64a87b24
      Boaz Harrosh 提交于
       - struct scsi_cmnd had a 16 bytes command buffer of its own.
         This is an unnecessary duplication and copy of request's
         cmd. It is probably left overs from the time that scsi_cmnd
         could function without a request attached. So clean that up.
      
       - Once above is done, few places, apart from scsi-ml, needed
         adjustments due to changing the data type of scsi_cmnd->cmnd.
      
       - Lots of drivers still use MAX_COMMAND_SIZE. So I have left
         that #define but equate it to BLK_MAX_CDB. The way I see it
         and is reflected in the patch below is.
         MAX_COMMAND_SIZE - means: The longest fixed-length (*) SCSI CDB
                            as per the SCSI standard and is not related
                            to the implementation.
         BLK_MAX_CDB.     - The allocated space at the request level
      
       - I have audit all ISA drivers and made sure none use ->cmnd in a DMA
         Operation. Same audit was done by Andi Kleen.
      
      (*)fixed-length here means commands that their size can be determined
         by their opcode and the CDB does not carry a length specifier, (unlike
         the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
         true and the SCSI standard also defines extended commands and
         vendor specific commands that can be bigger than 16 bytes. The kernel
         will support these using the same infrastructure used for VARLEN CDB's.
         So in effect MAX_COMMAND_SIZE means the maximum size command
         scsi-ml supports without specifying a cmd_len by ULD's
      Signed-off-by: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      64a87b24
  5. 30 4月, 2008 1 次提交
  6. 23 4月, 2008 1 次提交
    • J
      [SCSI] rework scsi_target allocation · 643eb2d9
      James Bottomley 提交于
      The current target allocation code registeres each possible target
      with sysfs; it will be deleted again if no useable LUN on this target
      was found. This results in a string of 'target add/target remove' uevents.
      
      Based on a patch by Hannes Reinecke <hare@suse.de> this patch reworks
      the target allocation code so that only uevents for existing targets
      are sent. The sysfs registration is split off from the existing
      scsi_target_alloc() into a in a new scsi_add_target() function, which
      should be called whenever an existing target is found. Only then a
      uevent is sent, so we'll be generating events for existing targets
      only.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      643eb2d9
  7. 20 4月, 2008 1 次提交
  8. 19 4月, 2008 2 次提交
  9. 08 4月, 2008 6 次提交
  10. 06 3月, 2008 1 次提交
  11. 24 2月, 2008 1 次提交
  12. 12 2月, 2008 1 次提交
    • J
      [SCSI] update SG_ALL to avoid causing chaining · 4660c8ed
      James Bottomley 提交于
      Since the sg chaining patches went in, our current value of 255 for
      SG_ALL excites chaining on some drivers which cannot support it (and
      would thus oops).  Redefine SG_ALL to mean no sg table size
      preference, but use the single allocation (non chained) limit.  This
      also helps for drivers that use it to size an internal table.
      
      We'll do an opt in system later where truly chaining supporting
      drivers can define their sg_tablesize to be anything up to
      SCSI_MAX_SG_CHAIN_ELEMENTS.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      4660c8ed
  13. 08 2月, 2008 8 次提交
  14. 03 2月, 2008 1 次提交
  15. 31 1月, 2008 5 次提交
    • F
    • J
      [SCSI] remove use_sg_chaining · d3f46f39
      James Bottomley 提交于
      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.
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      d3f46f39
    • B
      [SCSI] bidirectional command support · 6f9a35e2
      Boaz Harrosh 提交于
      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: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      6f9a35e2
    • B
      [SCSI] implement scsi_data_buffer · 30b0c37b
      Boaz Harrosh 提交于
      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: NBoaz Harrosh <bharrosh@panasas.com>
      Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      30b0c37b
    • B
      [SCSI] tgt: use scsi_init_io instead of scsi_alloc_sgtable · bb52d82f
      Boaz Harrosh 提交于
      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: NBoaz Harrosh <bharrosh@panasas.com>
      Acked-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
      bb52d82f