13 Jan, 2018

1 commit

  • iscsi_parse_pr_out_transport_id launders the const away via a call to
    strstr(), and then modifies the buffer (writing a nul byte) through
    the return value. It's cleaner to be honest and simply declare the
    parameter as "char*", fixing up the call chain, and allowing us to
    drop the cast in the return statement.

    Amusingly, the two current callers found it necessary to cast a
    non-const pointer to a const.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: Nicholas Bellinger

    Rasmus Villemoes
     

07 Jul, 2017

1 commit


05 Jul, 2015

1 commit

  • Pull SCSI target updates from Nicholas Bellinger:
    "It's been a busy development cycle for target-core in a number of
    different areas.

    The fabric API usage for se_node_acl allocation is now within
    target-core code, dropping the external API callers for all fabric
    drivers tree-wide.

    There is a new conversion to RCU hlists for se_node_acl and
    se_portal_group LUN mappings, that turns fast-past LUN lookup into a
    completely lockless code-path. It also removes the original
    hard-coded limitation of 256 LUNs per fabric endpoint.

    The configfs attributes for backends can now be shared between core
    and driver code, allowing existing drivers to use common code while
    still allowing flexibility for new backend provided attributes.

    The highlights include:

    - Merge sbc_verify_dif_* into common code (sagi)
    - Remove iscsi-target support for obsolete IFMarker/OFMarker
    (Christophe Vu-Brugier)
    - Add bidi support in target/user backend (ilias + vangelis + agover)
    - Move se_node_acl allocation into target-core code (hch)
    - Add crc_t10dif_update common helper (akinobu + mkp)
    - Handle target-core odd SGL mapping for data transfer memory
    (akinobu)
    - Move transport ID handling into target-core (hch)
    - Move task tag into struct se_cmd + support 64-bit tags (bart)
    - Convert se_node_acl->device_list[] to RCU hlist (nab + hch +
    paulmck)
    - Convert se_portal_group->tpg_lun_list[] to RCU hlist (nab + hch +
    paulmck)
    - Simplify target backend driver registration (hch)
    - Consolidate + simplify target backend attribute implementations
    (hch + nab)
    - Subsume se_port + t10_alua_tg_pt_gp_member into se_lun (hch)
    - Drop lun_sep_lock for se_lun->lun_se_dev RCU usage (hch + nab)
    - Drop unnecessary core_tpg_register TFO parameter (nab)
    - Use 64-bit LUNs tree-wide (hannes)
    - Drop left-over TARGET_MAX_LUNS_PER_TRANSPORT limit (hannes)"

    * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (76 commits)
    target: Bump core version to v5.0
    target: remove target_core_configfs.h
    target: remove unused TARGET_CORE_CONFIG_ROOT define
    target: consolidate version defines
    target: implement WRITE_SAME with UNMAP bit using ->execute_unmap
    target: simplify UNMAP handling
    target: replace se_cmd->execute_rw with a protocol_data field
    target/user: Fix inconsistent kmap_atomic/kunmap_atomic
    target: Send UA when changing LUN inventory
    target: Send UA upon LUN RESET tmr completion
    target: Send UA on ALUA target port group change
    target: Convert se_lun->lun_deve_lock to normal spinlock
    target: use 'se_dev_entry' when allocating UAs
    target: Remove 'ua_nacl' pointer from se_ua structure
    target_core_alua: Correct UA handling when switching states
    xen-scsiback: Fix compile warning for 64-bit LUN
    target: Remove TARGET_MAX_LUNS_PER_TRANSPORT
    target: use 64-bit LUNs
    target: Drop duplicate + unused se_dev_check_wce
    target: Drop unnecessary core_tpg_register TFO parameter
    ...

    Linus Torvalds
     

04 Jun, 2015

1 commit


02 Jun, 2015

1 commit

  • Only include SCSI initiator header files in target code that needs
    these header files, namely the SCSI pass-through code and the tcm_loop
    driver. Change SCSI_SENSE_BUFFERSIZE into TRANSPORT_SENSE_BUFFER in
    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
    drivers/target/loopback/tcm_loop.c:31:#include
    drivers/target/loopback/tcm_loop.c:32:#include
    drivers/target/loopback/tcm_loop.c:33:#include
    drivers/target/target_core_pscsi.c:39:#include
    drivers/target/target_core_pscsi.c:40:#include
    drivers/xen/xen-scsiback.c:52:#include /* SG_ALL */

    Signed-off-by: Bart Van Assche
    Reviewed-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Bart Van Assche
     

31 May, 2015

3 commits


18 Sep, 2014

1 commit


11 Sep, 2013

1 commit


28 Nov, 2012

1 commit


18 Sep, 2012

1 commit


14 Dec, 2011

3 commits

  • 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
    useless.

    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
    these.

    Signed-off-by: Joern Engel
    Signed-off-by: Nicholas Bellinger

    Jörn Engel
     
  • 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: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • 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: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

01 Nov, 2011

1 commit


21 Sep, 2011

1 commit

  • Now that hex2bin does error checking, on error add debugging error msg.

    Changelog v1 (update):
    - fixed definition of 'ret'
    - hex2bin now returns an int

    Signed-off-by: Mimi Zohar
    Acked-by: Andy Shevchenko

    Mimi Zohar
     

22 Jul, 2011

2 commits

  • This patch drops transport_asciihex_to_binaryhex() in favor of proper
    hex2bin usage from include/linux/kernel.h:hex2bin()

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Nicholas Bellinger

    Andy Shevchenko
     
  • 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: Andy Grover
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     

31 Mar, 2011

1 commit


24 Mar, 2011

1 commit

  • This patch addresses the majority of sparse warnings and adds
    proper locking annotations. It also fixes the dubious one-bit signed
    bitfield, for which the signed one-bit types can be 0 or -1 which can
    cause a problem if someone ever checks if (foo->lu_gp_assoc == 1).
    The current code is fine because everyone just checks zero vs non-zero.
    But Sparse complains about it so lets change it. The warnings look like
    this:

    include/target/target_core_base.h:228:26: error: dubious one-bit signed bitfield

    Signed-off-by: Dan Carpenter
    Signed-off-by: Fubo Chen
    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Dan Carpenter
     

02 Mar, 2011

1 commit


15 Jan, 2011

1 commit

  • LIO target is a full featured in-kernel target framework with the
    following feature set:

    High-performance, non-blocking, multithreaded architecture with SIMD
    support.

    Advanced SCSI feature set:

    * Persistent Reservations (PRs)
    * Asymmetric Logical Unit Assignment (ALUA)
    * Protocol and intra-nexus multiplexing, load-balancing and failover (MC/S)
    * Full Error Recovery (ERL=0,1,2)
    * Active/active task migration and session continuation (ERL=2)
    * Thin LUN provisioning (UNMAP and WRITE_SAMExx)

    Multiprotocol target plugins

    Storage media independence:

    * Virtualization of all storage media; transparent mapping of IO to LUNs
    * No hard limits on number of LUNs per Target; maximum LUN size ~750 TB
    * Backstores: SATA, SAS, SCSI, BluRay, DVD, FLASH, USB, ramdisk, etc.

    Standards compliance:

    * Full compliance with IETF (RFC 3720)
    * Full implementation of SPC-4 PRs and ALUA

    Significant code cleanups done by Christoph Hellwig.

    [jejb: fix up for new block bdev exclusive interface. Minor fixes from
    Randy Dunlap and Dan Carpenter.]
    Signed-off-by: Nicholas A. Bellinger
    Signed-off-by: James Bottomley

    Nicholas Bellinger