1. 16 11月, 2012 1 次提交
    • N
      target: Add/check max_write_same_len device attribute + update block limits VPD · 773cbaf7
      Nicholas Bellinger 提交于
      This patch adds a new max_write_same_len device attribute for use with
      WRITE_SAME w/ UNMAP=0 backend emulation.  This can be useful for
      lowering the default backend value (IBLOCK uses 0xFFFF).
      
      Also, update block limits VPD emulation code in spc_emulate_evpd_b0() to
      report MAXIMUM WRITE SAME LENGTH, and enforce max_write_same_len during
      sbc_parse() -> sbc_setup_write_same() CDB sanity checking for all emulated
      WRITE_SAME w/ UNMAP=0 cases.
      
      (Robert: Move max_write_same_len check in sbc_setup_write_same() to
               check both WRITE_SAME w/ UNMAP=1 and w/ UNMAP=0 cases)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Robert Elliott <Elliott@hp.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      773cbaf7
  2. 07 11月, 2012 3 次提交
  3. 01 11月, 2012 1 次提交
  4. 18 9月, 2012 4 次提交
  5. 17 7月, 2012 2 次提交
  6. 17 5月, 2012 1 次提交
    • N
      target: Add MI_REPORT_TARGET_PGS ext. header + implict_trans_secs attribute · 5b9a4d72
      Nicholas Bellinger 提交于
      This patch adds support for ALUA MI_REPORT_TARGET_PGS extended header
      format defined within SPC-4.  It changes target core ALUA emulation logic
      within target_emulate_report_target_port_groups() to support both the
      extended and original length only header formats.
      
      It includes adding a new 'implict_trans_secs' attribute for each ALUA
      target port group to control the value returned to the application client
      for an recommended implict translation timeout in seconds.  By default
      this value is currently set to zero, and limited up to 255 by virtue of
      using a single byte in the extended header format.
      
      This value is used by target_emulate_report_target_port_groups() within
      the extended header logic to set IMPLICIT TRANSITION TIME as defined by
      spc4r30.
      
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Rob Evers <revers@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5b9a4d72
  7. 10 5月, 2012 1 次提交
    • N
      target: Remove max_sectors device attribute for modern se_task less code · 11e764bd
      Nicholas Bellinger 提交于
      This patch removes the original usage of dev_attr->max_sectors in favor of
      dev_attr->hw_max_sectors that is now being enforced by target core from
      within transport_generic_cmd_sequencer() for SCF_SCSI_DATA_SG_IO_CDB ops.
      
      After the recent se_task removal patches from hch, this value for IBLOCK
      backends being set via configfs by userspace from an saved max_sectors
      value that is turning out to be problematic, so it makes sense to go ahead
      and remove this now legacy attribute all-together.
      
      This patch also continues to make se_dev_set_default_attribs() do
      (sectors / block_size) alignment for what actually get used by
      target_core_mod to be safe here, following the same alignment currently
      used by fabric_max_sectors.
      Reported-by: NAndy Grover <agrover@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      11e764bd
  8. 16 3月, 2012 1 次提交
  9. 11 3月, 2012 2 次提交
  10. 26 2月, 2012 2 次提交
    • R
      target: Untangle front-end and back-end meanings of max_sectors attribute · 015487b8
      Roland Dreier 提交于
      se_dev_attrib.max_sectors currently has two independent meanings:
      
       - It is reported in the block limits VPD page as the maximum transfer
         length, ie the largest IO that the front-end (fabric) can handle.
         Also the target core doesn't enforce this maximum transfer length.
      
       - It is used to hold the size of the largest IO that the back-end can
         handle, so we know when to split SCSI commands into multiple tasks.
      
      Fix this by adding a new se_dev_attrib.fabric_max_sectors to hold the
      maximum transfer length, and checking incoming IOs against that limit.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      015487b8
    • R
      target: Use LIST_HEAD()/DEFINE_MUTEX() for static objects · d0f474e5
      Roland Dreier 提交于
      Instead of
      
         static struct list_head foo;
         static struct mutex bar;
      
         ...
      
         INIT_LIST_HEAD(&foo);
         mutex_init(&bar);
      
      just do
      
         static LIST_HEAD(foo);
         static DEFINE_MUTEX(bar);
      
      Also remove some superfluous struct list_head and spinlock_t
      initialization calls where the variables are already defined using
      macros that initialize them.
      
      This saves a decent amount of compiled code too:
      
          add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-178 (-178)
          function                                     old     new   delta
          target_core_init_configfs                    898     850     -48
          core_scsi3_emulate_pro_preempt              1742    1683     -59
          iscsi_thread_set_init                        159      88     -71
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d0f474e5
  11. 07 2月, 2012 1 次提交
  12. 14 12月, 2011 5 次提交
  13. 06 12月, 2011 1 次提交
  14. 24 10月, 2011 2 次提交
  15. 11 10月, 2011 1 次提交
  16. 15 9月, 2011 1 次提交
  17. 22 7月, 2011 10 次提交
    • A
      target: fix typo Assoication -> Association · 163cd5fa
      Andy Shevchenko 提交于
      Additionally this patch brings proper apply of the designator type.
      However, the original code luckily has no bug, because the association
      equals to 0.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: James Bottomley <jbottomley@parallels.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      163cd5fa
    • N
      target: Update QUEUE ALGORITHM MODIFIER control page default · 5de619a3
      Nicholas Bellinger 提交于
      This patch adds the default 'Unrestricted reordering allowed' for SCSI
      control mode page QUEUE ALGORITHM MODIFIER on a per se_device basis in
      target_modesense_control() following spc4r23.  This includes a new
      emuluate_rest_reord configfs attribute that currently (only) accepts
      zero to signal 'Unrestricted reordering allowed' in control mode page
      usage by the backend target device.
      Reported-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@risingtidesystems.com>
      5de619a3
    • A
      target: Follow up core updates from AGrover and HCH (round 4) · 6708bb27
      Andy Grover 提交于
      This patch contains the squashed version of forth round series cleanups
      from Andy and Christoph following the post heavy lifting in the preceeding:
      'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
      changes.  This also includes a conversion of target core and the v3.0
      mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
      CONFIG_DYNAMIC_DEBUG infrastructure!
      
      These have been squashed into this third and final round for v3.1.
      
      target: Remove ifdeffed code in t_g_process_write
      target: Remove direct ramdisk code
      target: Rename task_sg_num to task_sg_nents
      target: Remove custom debug macros for pr_debug. Use pr_err().
      target: Remove custom debug macros in mainline fabrics
      target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
      target: Remove transport do_se_mem_map callback
      target: Further simplify transport_free_pages
      target: Redo task allocation return value handling
      target: Remove extra parentheses
      target: change alloc_task call to take *cdb, not *cmd
      
      (nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      6708bb27
    • R
      target: Implement Block Device Characteristics VPD page · e22a7f07
      Roland Dreier 提交于
      Implement page B1h, Block Device Characteristics, so that we can report
      a medium rotation rate of 1 (non-rotating / solid state) if the
      is_nonrot device attribute is set; we update the iblock backend to set
      this attribute if the underlying Linux block device has its nonrot
      flag set.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e22a7f07
    • R
      target: Allow for built-in target modules · f5fbed85
      Roland Dreier 提交于
      In target_fabric_configfs_init(), we should allow fabric_mod to be NULL,
      since THIS_MODULE is NULL for built-in modules.  The main method of
      using the target code may be as modules, but having everything built-in
      is useful eg to be able to do quick testing with "qemu -kernel".
      
      In any case, we shouldn't bomb out fabric registration for a perfectly
      valid configuration, so simply drop the check of fabric_mod.
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f5fbed85
    • C
      target: merge release_cmd methods · 35462975
      Christoph Hellwig 提交于
      The release_cmd_to_pool and release_cmd_direct methods are always the same.
      Merge them into a single release_cmd method, and clean up the fallout.
      
      (nab: fix breakage in transport_generic_free_cmd() parameter build breakage
       in drivers/target/tcm_fc/tfc_cmd.c)
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      35462975
    • C
    • A
      target: More core cleanups from AGrover (round 2) · 5951146d
      Andy Grover 提交于
      This patch contains the squashed version of second round of target core
      cleanups and simplifications and Andy and Co.   It also contains a handful
      of fixes to address bugs the original series and other minor cleanups.
      
      Here is the condensed shortlog:
      
      target: Remove unneeded casts to void*
      target: Rename get_lun_for_{cmd,tmr} to lookup_{cmd,tmr}_lun
      target: Make t_task a member of se_cmd, not a pointer
      target: Handle functions returning "-2"
      target: Use cmd->se_dev over cmd->se_lun->lun_se_dev
      target: Embed qr in struct se_cmd
      target: Replace embedded struct se_queue_req with a list_head
      target: Rename list_heads that are nodes in struct se_cmd to "*_node"
      target: Fold transport_device_setup_cmd() into lookup_{tmr,cmd}_lun()
      target: Make t_mem_list and t_mem_list_bidi members of t_task
      target: Add comment & cleanup transport_map_sg_to_mem()
      target: Remove unneeded checks in transport_free_pages()
      
      (Roland: Fix se_queue_req removal leftovers OOPs)
      (nab: Fix transport_lookup_tmr_lun failure case)
      (nab: Fix list_empty(&cmd->t_task.t_mem_bidi_list) inversion bugs)
      Signed-off-by: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5951146d
    • A
      target: Core cleanups from AGrover (round 1) · e3d6f909
      Andy Grover 提交于
      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: NAndy Grover <agrover@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      e3d6f909
    • N
      target: Remove unused su_group usage in fabric register/dergister · a8c6da90
      Nicholas Bellinger 提交于
      This patch removes two instances of left over v3.x code performing local
      scope access to struct target_core_fabric_ops->tf_subsys->su_group in
      target_fabric_configfs_register() and target_fabric_configfs_deregister().
      Reported-by: NChristophe Fergeau <cfergeau@gmail.com>
      Signed-off-by: NNicholas A. Bellinger <nab@linux-iscsi.org>
      a8c6da90
  18. 24 6月, 2011 1 次提交
    • D
      target: Fix incorrect strlen() NULL terminator checks · 60d645a4
      Dan Carpenter 提交于
      This patch fixes a number of cases in target core using an incorrectly
      
      	if (strlen(foo) > SOME_MAX_SIZE)
      
      As strlen() returns the number of characters in the string not counting
      the NULL character at the end.  So if you do something like:
      
              char buf[10];
      
              if (strlen("0123456789") > 10)
                      return -ETOOLONG;
              snprintf(buf, 10, "0123456789");
              printf("%s\n", buf);
      
      then the last "9" gets chopped off and only "012345678" is printed.
      
      Plus I threw in one small related cleanup.
      Signed-off-by: NDan Carpenter <error27@gmail.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      60d645a4