Skip to content
  1. Oct 18, 2018
  2. Oct 17, 2018
  3. Oct 16, 2018
    • Bart Van Assche's avatar
      scsi: target/core: Always call transport_complete_callback() upon failure · aa73237d
      Bart Van Assche authored
      
      
      COMPARE AND WRITE command execution starts with a call of
      sbc_compare_and_write(). That function locks the caw_sem member in the
      backend device data structure and submits a read request to the backend
      driver. Upon successful completion of the read compare_and_write_callback()
      gets called. That last function compares the data that has been read. If it
      matches transport_complete_callback is set to compare_and_write_post and a
      write request is submitted. compare_and_write_post() submits a write request
      to the backend driver.
      
      XDWRITEREAD command execution starts with sbc_execute_rw() submitting a
      read to the backend device. Upon successful completion of the read the
      xdreadwrite_callback() gets called. That function xors the data that has
      been read with the data in the data-out buffer and stores the result in
      the data-in buffer.
      
      Call transport_complete_callback() not only if COMPARE AND WRITE fails but
      also if XDWRITEREAD fails. This makes the code more systematic. Make sure
      that the callback functions handle (cmd, false, NULL) argument triples fine.
      
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Cc: Mike Christie <mchristi@redhat.com>
      Cc: Hannes Reinecke <hare@suse.de>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      aa73237d
    • Bart Van Assche's avatar
      scsi: target/core: Use sg_alloc_table() instead of open-coding it · 81b6ca6d
      Bart Van Assche authored
      
      
      The purpose of sg_alloc_table() is to allocate and initialize an
      sg-list. Use that function instead of open-coding it. This patch will
      make it easier to share code for caching sg-list allocations between the
      SCSI and NVMe target cores.
      
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: Mike Christie <mchristi@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      81b6ca6d