1. 06 Mar, 2016 1 commit
  2. 28 Nov, 2015 1 commit
  3. 13 Oct, 2015 1 commit
  4. 02 Jun, 2015 1 commit
    • Bart Van Assche's avatar
      target: Minimize SCSI header #include directives · ba929992
      Bart Van Assche authored
      Only include SCSI initiator header files in target code that needs
      these header files, namely the SCSI pass-through code and the tcm_loop
      target code because the former is intended for initiator code and the
      latter for target code. With this patch the only initiator include
      directives in target code that remain are as follows:
      $ git grep -nHE 'include .scsi/(scsi.h|scsi_host.h|scsi_device.h|scsi_cmnd.h)' drivers/target drivers/infiniband/ulp/{isert,srpt} drivers/usb/gadget/legacy/tcm_*.[ch] drivers/{vhost,xen} include/{target,trace/events/target.h}
      drivers/target/loopback/tcm_loop.c:29:#include <scsi/scsi.h>
      drivers/target/loopback/tcm_loop.c:31:#include <scsi/scsi_host.h>
      drivers/target/loopback/tcm_loop.c:32:#include <scsi/scsi_device.h>
      drivers/target/loopback/tcm_loop.c:33:#include <scsi/scsi_cmnd.h>
      drivers/target/target_core_pscsi.c:39:#include <scsi/scsi_device.h>
      drivers/target/target_core_pscsi.c:40:#include <scsi/scsi_host.h>
      drivers/xen/xen-scsiback.c:52:#include <scsi/scsi_host.h> /* SG_ALL */
      Signed-off-by: 's avatarBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarJames Bottomley <JBottomley@Odin.com>
  5. 01 Jun, 2015 3 commits
    • Nicholas Bellinger's avatar
      target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage · 4cc987ea
      Nicholas Bellinger authored
      With se_port and t10_alua_tg_pt_gp_member being absored into se_lun,
      there is no need for an extra lock to protect se_lun->lun_se_dev
      This patch also converts backend drivers to use call_rcu() release
      to allow any se_device readers to complete.  The call_rcu() instead
      of kfree_rcu() is required here because se_device is embedded into
      the backend driver specific structure.
      Also, convert se_lun->lun_stats to use atomic_long_t within the
      target_complete_ok_work() completion callback, and add FIXME for
      transport_lookup_tmr_lun() with se_lun->lun_ref.
      Finally, update sbp_update_unit_directory() special case usage with
      proper rcu_dereference_raw() and configfs symlink comment.
      Reported-by: 's avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: 's avatarHannes Reinecke <hare@suse.de>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Chris Boot <bootc@bootc.net>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
    • Christoph Hellwig's avatar
      target: Subsume se_port + t10_alua_tg_pt_gp_member into se_lun · adf653f9
      Christoph Hellwig authored
      This patch eliminates all se_port + t10_alua_tg_pt_gp_member usage,
      and converts current users to direct se_lun pointer dereference.
      This includes the removal of core_export_port(), core_release_port()
      core_dev_export() and core_dev_unexport().  Along with conversion
      of special case se_lun pointer dereference within PR ALL_TG_PT=1
      and ALUA access state transition UNIT_ATTENTION handling.
      Also, update core_enable_device_list_for_node() to reference the
      new per se_lun->lun_deve_list when creating a new entry, or
      replacing an existing one via RCU.
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: 's avatarHannes Reinecke <hare@suse.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
    • Nicholas Bellinger's avatar
      target: Convert se_node_acl->device_list[] to RCU hlist · 29a05dee
      Nicholas Bellinger authored
      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: 's avatarHannes 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: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
  6. 30 May, 2015 1 commit
  7. 13 Nov, 2013 1 commit
  8. 12 Nov, 2013 1 commit
  9. 10 Sep, 2013 1 commit
  10. 27 Nov, 2012 1 commit
  11. 06 Nov, 2012 1 commit
  12. 17 Sep, 2012 1 commit
  13. 15 Mar, 2012 2 commits
  14. 14 Dec, 2011 3 commits
    • Jörn Engel's avatar
      target: remove useless casts · 8359cf43
      Jörn Engel authored
      A reader should spend an extra moment whenever noticing a cast,
      because either something special is going on that deserves extra
      attention or, as is all too often the case, the code is wrong.
      These casts, afaics, have all been useless.  They cast a foo* to a
      foo*, cast a void* to the assigned type, cast a foo* to void*, before
      assigning it to a void* variable, etc.
      In a few cases I also removed an additional &...[0], which is equally
      Lastly I added three FIXMEs where, to the best of my judgement, the
      code appears to have a bug.  It would be good if someone could check
      Signed-off-by: 's avatarJoern Engel <joern@logfs.org>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
    • Christoph Hellwig's avatar
      target: header reshuffle, part2 · c4795fb2
      Christoph Hellwig authored
      This reorganized the headers under include/target into:
       - target_core_base.h stays as is with all target-wide data stuctures and defines
       - target_core_backend.h contains the whole interface to I/O backends
       - target_core_fabric.h contains the whole interface to fabric modules
      Except for those only the various configfs macro headers stay around.
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
    • Christoph Hellwig's avatar
      target: reshuffle headers · e26d99ae
      Christoph Hellwig authored
      Create a new headers, drivers/target/target_core_internal.h that is supposed
      to hold all target_core-internal prototypes.  Move all non-exported includes
      from include/target to it, and merge the smaller prototype-only includes
      inside drivers/target into it as well.  Mark functions that were found to
      not be called outside their implementation file static.
      Signed-off-by: 's avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
  15. 10 Oct, 2011 1 commit
  16. 15 Sep, 2011 1 commit
  17. 22 Jul, 2011 1 commit
    • Andy Grover's avatar
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover authored
      This patch contains the squashed version of a number of cleanups and
      minor fixes from Andy's initial series (round 1) for target core this
      past spring.  The condensed log looks like:
      target: use errno values instead of returning -1 for everything
      target: Rename transport_calc_sg_num to transport_init_task_sg
      target: Fix leak in error path in transport_init_task_sg
      target/pscsi: Remove pscsi_get_sh() usage
      target: Make two runtime checks into WARN_ONs
      target: Remove hba queue depth and convert to spin_lock_irq usage
      target: dev->dev_status_queue_obj is unused
      target: Make struct se_queue_req.cmd type struct se_cmd *
      target: Remove __transport_get_qr_from_queue()
      target: Rename se_dev->g_se_dev_list to se_dev_node
      target: Remove struct se_global
      target: Simplify scsi mib index table code
      target: Make dev_queue_obj a member of se_device instead of a pointer
      target: remove extraneous returns at end of void functions
      target: Ensure transport_dump_vpd_ident_type returns null-terminated str
      target: Function pointers don't need to use '&' to be assigned
      target: Fix comment in __transport_execute_tasks()
      target: Misc style cleanups
      target: rename struct pr_reservation_template to pr_reservation
      target: Remove #defines that just perform indirection
      target: Inline transport_get_task_from_execute_queue()
      target: Minor header comment fixes
      Signed-off-by: 's avatarAndy Grover <agrover@redhat.com>
      Signed-off-by: 's avatarNicholas Bellinger <nab@linux-iscsi.org>
  18. 23 Mar, 2011 1 commit
    • Nicholas Bellinger's avatar
      [SCSI] target: add initial statistics · 12d23384
      Nicholas Bellinger authored
      This patch adds a target_core_mib.c statistics conversion for
      backend context struct se_subsystem_dev + struct se_device config_group
      based statistics in target_core_device.c using CONFIGFS_EATTR()
      based struct config_item_types from target_core_stat.c code.
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_dev, scsi_lu, and scsi_tgt_dev output
      from within individual:
      The legacy procfs output now appear as individual configfs attributes under:
      *) $HBA/$DEV/statistics/scsi_dev:
      |-- indx
      |-- inst
      |-- ports
      `-- role
      *) $HBA/$DEV/statistics/scsi_lu:
      |-- creation_time
      |-- dev
      |-- dev_type
      |-- full_stat
      |-- hs_num_cmds
      |-- indx
      |-- inst
      |-- lu_name
      |-- lun
      |-- num_cmds
      |-- prod
      |-- read_mbytes
      |-- resets
      |-- rev
      |-- state_bit
      |-- status
      |-- vend
      `-- write_mbytes
      *) $HBA/$DEV/statistics/scsi_tgt_dev:
      |-- indx
      |-- inst
      |-- non_access_lus
      |-- num_lus
      |-- resets
      `-- status
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_port, scsi_tgt_port and scsi_transport
      output from within individual:
      The legacy procfs output now appear as individual configfs attributes under:
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_port
      |-- busy_count
      |-- dev
      |-- indx
      |-- inst
      `-- role
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_tgt_port
      |-- dev
      |-- hs_in_cmds
      |-- in_cmds
      |-- indx
      |-- inst
      |-- name
      |-- port_index
      |-- read_mbytes
      `-- write_mbytes
      *) fabric/$WWN/tpgt_$TPGT/lun/lun_$LUN_ID/statistics/scsi_transport
      |-- dev_name
      |-- device
      |-- indx
      `-- inst
      The conversion from backend /proc/scsi_target/mib/ context output to configfs
      default groups+attributes include scsi_att_intr_port and scsi_auth_intr output
      from within individual:
      The legacy procfs output now appear as individual configfs attributes under:
      *) acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/scsi_att_intr_port
      |-- dev
      |-- indx
      |-- inst
      |-- port
      |-- port_auth_indx
      `-- port_ident
      *) acls/$INITIATOR_WWN/lun_$LUN_ID/statistics/scsi_auth_intr
      |-- att_count
      |-- creation_time
      |-- dev
      |-- dev_or_port
      |-- hs_num_cmds
      |-- indx
      |-- inst
      |-- intr_name
      |-- map_indx
      |-- num_cmds
      |-- port
      |-- read_mbytes
      |-- row_status
      `-- write_mbytes
      Also, this includes adding struct target_fabric_configfs_template->
      tfc_wwn_fabric_stats_cit and ->tfc_tpg_nacl_stat_cit respectively for
      use during target_core_fabric_configfs.c:target_fabric_setup_cits()
      Signed-off-by: 's avatarNicholas A. Bellinger <nab@linux-iscsi.org>
      Signed-off-by: 's avatarJames Bottomley <James.Bottomley@suse.de>