1. 13 Dec, 2014 21 commits
  2. 02 Dec, 2014 19 commits
    • Julia Lawall's avatar
      target: remove unneeded array · 13ba564c
      Julia Lawall authored
      Delete a local array that is only used to be initialized by memset.
      
      A semantic patch that makes this change is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      identifier x;
      type T;
      @@
      
      {
      ... when any
      -T x[...];
      <+... when != x
      - memset(x,...);
      ...+>
      }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      13ba564c
    • Lino Sanfilippo's avatar
      iscsi-target: fix error path in iscsi_target_init_module() · 7f2c53bb
      Lino Sanfilippo authored
      In iscsi_target_init_module() unwind transport protocol registration in case
      that iscsit_load_discovery_tpg() failed.
      Signed-off-by: default avatarLino Sanfilippo <LinoSanfilippo@gmx.de>
      Reviewed-by: default avatarSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      7f2c53bb
    • Hannes Reinecke's avatar
      tcm_loop: Fix wrong I_T nexus association · 506787a2
      Hannes Reinecke authored
      tcm_loop has the I_T nexus associated with the HBA. This causes
      commands to become misdirected if the HBA has more than one
      target portal group; any command is then being sent to the
      first target portal group instead of the correct one.
      
      The nexus needs to be associated with the target portal group
      instead.
      Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
      Cc: <stable@vger.kernel.org> # 3.0+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      506787a2
    • Nicholas Bellinger's avatar
      target: Drop left-over PHBA_PDEV set attr checks · 4b2f57e5
      Nicholas Bellinger authored
      Now that PSCSI is only exposing four hw_* read-only device attributes,
      go ahead and drop the left-over -> legacy PHBA_PDEV checks in various
      se_dev_set_* code, since it's now only used by virtual devices.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      4b2f57e5
    • Nicholas Bellinger's avatar
      target: Drop left-over internal dev attribute code · 43cf208c
      Nicholas Bellinger authored
      Now that backend drivers are populating their own device attributes,
      go ahead and remove left-over definitions + internal attribute list
      of device attributes from target_core_configfs.c code
      
      Also update TB_CIT_SETUP(dev_attrib,...) to signal ct_attr = NULL.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      43cf208c
    • Nicholas Bellinger's avatar
      target/pscsi: Convert to external pscsi_backend_dev_attrs · 6cfb546b
      Nicholas Bellinger authored
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      6cfb546b
    • Nicholas Bellinger's avatar
      target/user: Convert to external tcmu_backend_dev_attrs · e9f720d6
      Nicholas Bellinger authored
      This patch converts TCM-USER 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
      generated by DEF_TB_DEFAULT_ATTRIBS(tcmu) populates tcmu_backend_dev_attrs[]
      
      It introduces no function change for existing TCMU device attributes.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      e9f720d6
    • Nicholas Bellinger's avatar
      target/rd: Convert to external rd_mcp_backend_dev_attrs · 03a62745
      Nicholas Bellinger authored
      This patch converts RAMDISK 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
      generated by DEF_TB_DEFAULT_ATTRIBS(rc_mcp) populates rd_mcp_backend_dev_attrs[]
      
      It introduces no functional change for existing RD_MCP device attributes.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      03a62745
    • Nicholas Bellinger's avatar
      target/file: Convert to external fileio_backend_dev_attrs · b2320497
      Nicholas Bellinger authored
      This patch converts FILEIO 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
      generated by DEF_TB_DEFAULT_ATTRIBS(fileio) populates fileio_backend_dev_attrs[]
      
      It introduces no functional change for existing FILEIO device attributes.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      b2320497
    • Nicholas Bellinger's avatar
      target/iblock: Convert to external iblock_backend_dev_attrs · 5645cba0
      Nicholas Bellinger authored
      This patch converts IBLOCK 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
      generated by DEF_TB_DEFAULT_ATTRIBS(iblock) populates iblock_backend_dev_attrs[]
      
      It introduces no functional change for existing IBLOCK device attributes.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      5645cba0
    • Nicholas Bellinger's avatar
      target: Add DEF_TB_DEFAULT_ATTRIBS macro for virtual device attrs · e6c39f70
      Nicholas Bellinger authored
      This helper macro adds the default set of 30 device attributes for
      virtual devices from existing target_core_configfs.c code, and moves
      the definitions into a single macro to create the structs necessary
      for backend drivers.
      
      It allows them to populate their own external struct configfs_attribute
      for se_subsystem_api->tb_cits.tb_dev_attrib_cit.ct_attrs.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      e6c39f70
    • Nicholas Bellinger's avatar
      target: Add EXPORT_SYMBOL for existing se_dev_set_* · d30cd123
      Nicholas Bellinger authored
      Now that target_core_backend_configfs.h macros will be using these
      se_dev_set attribute functions externally to allow backend drivers
      to populate different attributes, go ahead and add EXPORT_SYMBOL()
      for the existing default set of 30 device attributes.
      
      Also update target_core_backend.h with proper function prototypes.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      d30cd123
    • Nicholas Bellinger's avatar
      target: Add target_core_backend_configfs.h helper macros · 7a23f890
      Nicholas Bellinger authored
      This patch adds a number of configfs e-attr macros following
      what existing target_core_configfs.c code does for internal
      target_backend_dev_attrib setup, and similar to how target
      fabric drivers allow for external config_item_type + cit->ct_attrs.
      assignment.
      
      This is useful for backend drivers like PSCSI who need to only
      expose a small subset of device attributes, while still retaining
      a default list of attributes for other backend drivers like
      IBLOCK, FILEIO, RAMDISK, and TCMU.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      7a23f890
    • Nicholas Bellinger's avatar
      target: Move dev_stat_cit to struct se_subsystem_api · d23ab570
      Nicholas Bellinger authored
      This patch adds support for dev_stat_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets only ct_group_ops following
      existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_stat_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      d23ab570
    • Nicholas Bellinger's avatar
      target: Move dev_alua_tg_pt_gps_cit to struct se_subsystem_api · 72aca57b
      Nicholas Bellinger authored
      This patch adds support for dev_alua_tg_pt_gps_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets only ct_group_ops following
      existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_alua_tg_pt_gps_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      72aca57b
    • Nicholas Bellinger's avatar
      target: Move dev_wwn_cit to struct se_subsystem_api · f8d389c6
      Nicholas Bellinger authored
      This patch adds support for dev_wwn_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets both ct_item_ops + ct_attr
      following existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_wwn_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f8d389c6
    • Nicholas Bellinger's avatar
      target: Move dev_pr_cit to struct se_subsystem_api · 91e2e39b
      Nicholas Bellinger authored
      This patch adds support for dev_pr_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets both ct_item_ops + ct_attr
      following existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_pr_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      91e2e39b
    • Nicholas Bellinger's avatar
      target: Move dev_attrib_cit to struct se_subsystem_api · f79a897e
      Nicholas Bellinger authored
      This patch adds support for dev_attrib_cit as an external config_item_type
      using TB_CIT_SETUP() helper macro, and sets both ct_item_ops + ct_attr
      following existing code.
      
      It updates target_core_make_subdev() + target_core_setup_dev_attrib_cit() +
      struct target_backend_cits, and drops left-over target_core_dev_attrib_cit
      from target_core_configfs.c code and update comments.
      
      This patch introduces no functional change from existing code.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      f79a897e
    • Nicholas Bellinger's avatar
      target: Move dev_cit to struct se_subsystem_api · 73112edc
      Nicholas Bellinger authored
      This patch adds initial support for dev_cit as external config_item_type.
      
      This includes a new struct target_backend_cits to hold the external CITs
      within struct se_subsystem_api, and target_core_setup_sub_cits() to be
      used by backend drivers ahead of transport_subsystem_register().
      
      It adds a TB_CIT_SETUP() helper following target_core_fabric_configfs.c
      to perform the config_item_type assignments.
      
      Also, drop left-over target_core_dev_cit from target_core_configfs.c code
      and update comments.
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      73112edc