1. 01 6月, 2015 3 次提交
    • C
      target: consolidate backend attribute implementations · 5873c4d1
      Christoph Hellwig 提交于
      Provide a common sets of dev_attrib attributes for all devices using the
      generic SPC/SBC parsers, and a second one with the minimal required read-only
      attributes for passthrough devices.  The later is only used by pscsi for now,
      but will be wired up for the full-passthrough TCMU use case as well.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5873c4d1
    • C
      target: simplify backend driver registration · 0a06d430
      Christoph Hellwig 提交于
      Rewrite the backend driver registration based on what we did to the fabric
      drivers:  introduce a read-only struct target_bakckend_ops that the driver
      registers, which is then instanciate as a struct target_backend by the
      core.  This allows the ops vector to be smaller and allows us to mark it
      const.  At the same time the registration function can set up the
      configfs attributes, avoiding the need to add additional boilerplate code
      for that to the drivers.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      0a06d430
    • N
      target: Convert se_node_acl->device_list[] to RCU hlist · 29a05dee
      Nicholas Bellinger 提交于
      This patch converts se_node_acl->device_list[] table for mappedluns
      to modern RCU hlist_head usage in order to support an arbitrary number
      of node_acl lun mappings.
      
      It converts transport_lookup_*_lun() fast-path code to use RCU read path
      primitives when looking up se_dev_entry.  It adds a new hlist_head at
      se_node_acl->lun_entry_hlist for this purpose.
      
      For transport_lookup_cmd_lun() code, it works with existing per-cpu
      se_lun->lun_ref when associating se_cmd with se_lun + se_device.
      Also, go ahead and update core_create_device_list_for_node() +
      core_free_device_list_for_node() to use ->lun_entry_hlist.
      
      It also converts se_dev_entry->pr_ref_count access to use modern
      struct kref counting, and updates core_disable_device_list_for_node()
      to kref_put() and block on se_deve->pr_comp waiting for outstanding PR
      special-case PR references to drop, then invoke kfree_rcu() to wait
      for the RCU grace period to complete before releasing memory.
      
      So now that se_node_acl->lun_entry_hlist fast path access uses RCU
      protected pointers, go ahead and convert remaining non-fast path
      RCU updater code using ->lun_entry_lock to struct mutex to allow
      callers to block while walking se_node_acl->lun_entry_hlist.
      
      Finally drop the left-over core_clear_initiator_node_from_tpg() that
      originally cleared lun_access during se_node_acl shutdown, as post
      RCU conversion it now becomes duplicated logic.
      Reviewed-by: NHannes Reinecke <hare@suse.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      29a05dee
  2. 31 5月, 2015 3 次提交
  3. 20 3月, 2015 1 次提交
  4. 04 12月, 2014 1 次提交
  5. 02 12月, 2014 1 次提交
    • N
      target/pscsi: Convert to external pscsi_backend_dev_attrs · 6cfb546b
      Nicholas Bellinger 提交于
      This patch converts PSCSI to use an external set of device attributes,
      and utilizes target_core_backend_configfs.h macros to generate a default
      set of configfs extended-attr handlers.
      
      It calls target_core_setup_sub_cits() to setup the initial config_item_type
      based on existing target_core_configfs.c defaults, and using configfs_attribute
      for hw_pi_prot_type, hw_block_size, hw_max_sectors, hw_queue_depth populates
      pscsi_backend_dev_attrs[]
      
      Only these four hw_* read-only device attributes are exports for PSCSI.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6cfb546b
  6. 18 9月, 2014 1 次提交
  7. 29 8月, 2014 1 次提交
    • J
      block,scsi: fixup blk_get_request dead queue scenarios · a492f075
      Joe Lawrence 提交于
      The blk_get_request function may fail in low-memory conditions or during
      device removal (even if __GFP_WAIT is set). To distinguish between these
      errors, modify the blk_get_request call stack to return the appropriate
      ERR_PTR. Verify that all callers check the return status and consider
      IS_ERR instead of a simple NULL pointer check.
      
      For consistency, make a similar change to the blk_mq_alloc_request leg
      of blk_get_request.  It may fail if the queue is dead, or the caller was
      unwilling to wait.
      Signed-off-by: NJoe Lawrence <joe.lawrence@stratus.com>
      Acked-by: Jiri Kosina <jkosina@suse.cz> [for pktdvd]
      Acked-by: Boaz Harrosh <bharrosh@panasas.com> [for osd]
      Reviewed-by: NJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      a492f075
  8. 18 7月, 2014 1 次提交
  9. 06 6月, 2014 1 次提交
    • J
      block: add blk_rq_set_block_pc() · f27b087b
      Jens Axboe 提交于
      With the optimizations around not clearing the full request at alloc
      time, we are leaving some of the needed init for REQ_TYPE_BLOCK_PC
      up to the user allocating the request.
      
      Add a blk_rq_set_block_pc() that sets the command type to
      REQ_TYPE_BLOCK_PC, and properly initializes the members associated
      with this type of request. Update callers to use this function instead
      of manipulating rq->cmd_type directly.
      
      Includes fixes from Christoph Hellwig <hch@lst.de> for my half-assed
      attempt.
      Signed-off-by: NJens Axboe <axboe@fb.com>
      f27b087b
  10. 26 10月, 2013 1 次提交
  11. 11 9月, 2013 1 次提交
  12. 10 9月, 2013 1 次提交
  13. 20 3月, 2013 1 次提交
  14. 28 2月, 2013 4 次提交
  15. 28 11月, 2012 1 次提交
  16. 07 11月, 2012 6 次提交
  17. 18 9月, 2012 1 次提交
  18. 08 9月, 2012 1 次提交
    • P
      target: go through normal processing for zero-length PSCSI commands · 306c11b2
      Paolo Bonzini 提交于
      Right now, commands with a zero-size payload are skipped completely.
      This is wrong; such commands should be passed down to the device and
      processed normally.
      
      For physical backends, this ignores completely things such as START
      STOP UNIT.  For virtual backends, we have a hack in place to clear a
      unit attention state on a zero-size REQUEST SENSE, but we still do
      not report errors properly on zero-length commands---out-of-bounds
      0-block reads and writes, too small parameter list lengths, etc.
      
      This patch fixes this for PSCSI.  Uses of transport_kmap_data_sg are
      guarded with a check for non-zero cmd->data_length; for all other
      commands a zero length is handled properly in pscsi_execute_cmd.
      The sole exception will be for now REPORT LUNS, which is handled
      through the normal SPC emulation.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      306c11b2
  19. 06 9月, 2012 1 次提交
  20. 17 8月, 2012 1 次提交
    • N
      target/pscsi: Fix bug with REPORT_LUNs handling for SCSI passthrough · 1d2a2cd9
      Nicholas Bellinger 提交于
      This patch fixes a regression bug in pscsi_transport_complete() callback
      code where *pt was being NULL dereferenced during REPORT_LUNS handling,
      that was introduced with the spc/sbc refactoring in:
      
      commit 1fd032ee
      Author: Christoph Hellwig <hch@infradead.org>
      Date:   Sun May 20 11:59:15 2012 -0400
      
          target: move code for CDB emulation
      
      As this is a special case for pscsi_parse_cdb() to call spc_parse_cdb() to
      allow TCM to handle REPORT_LUN emulation, pscsi_plugin_task will have not
      been allocated..
      
      So now in pscsi_transport_complete() just check for existence of *pt and
      return for this special case.
      Reported-by: NAlex Elsayed <eternaleye+usenet@gmail.com>
      Cc: Alex Elsayed <eternaleye+usenet@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1d2a2cd9
  21. 17 7月, 2012 6 次提交
  22. 07 5月, 2012 2 次提交