28 Nov, 2012

1 commit

  • We already expect TFO->get_blocks() to return sector_t for zero value case
    when doing WRITE_SAME to the end of the backend device, so go ahead and return
    sector_t from spc_get_write_same_sectors() to handle this case properly.

    Also, update the single iblock_execute_write_same() caller of this code.

    Cc: Christoph Hellwig
    Cc: Martin K. Petersen
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

16 Nov, 2012

1 commit

  • This patch adds a new sbc_ops->execute_write_same_unmap() caller for use
    with WRITE_SAME w/ UNMAP=1, and performs the ->execute_cmd() setup based
    this bit within sbc_setup_write_same() code.

    Also, makes the changes in sbc_parse_cdb() to handle a sense_reason_t
    return from sbc_setup_write_same() on error.

    Reported-by: Christoph Hellwig
    Cc: Martin K. Petersen
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

07 Nov, 2012

6 commits


18 Sep, 2012

1 commit

  • This patch drops se_subsystem_api->[write_cache,fua_write]_emulated flags
    set by viritual FILEIO/IBLOCK/RD_MCP backend drivers in favor of explict
    TRANSPORT_PLUGIN_PHBA_PDEV checks to know when to fail if userspace is
    attempting to set virtual emulation bits for an pSCSI (passthrough)
    backend device.

    Reported-by: Christoph Hellwig
    Cc: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Nicholas Bellinger
     

06 Sep, 2012

1 commit

  • The pointer to the sense buffer is fetched by transport_get_sense_data,
    but this is called by target_complete_ok_work long after pscsi_req_done
    has freed the struct that contains it.

    Pass instead the fabric's sense buffer to transport_complete,
    and copy the data to it directly in transport_complete. Setting
    SCF_TRANSPORT_TASK_SENSE also becomes a duty of transport_complete.

    Signed-off-by: Paolo Bonzini
    Cc: stable@vger.kernel.org
    Signed-off-by: Nicholas Bellinger

    Paolo Bonzini
     

17 Jul, 2012

6 commits

  • Having all the unmap payload parsing in the backed is a bit ugly, but until
    more drivers support it and we can find a good interface for all of them
    that seems the way to go.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Add spc_ops->execute_write_same() caller for ->execute_cmd() setup,
    and update IBLOCK backends to use it.

    (nab: add export of spc_get_write_same_sectors symbol)
    (roland: Carry forward: Fix range calculation in WRITE SAME emulation
    when num blocks == 0)

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Add spc_ops->execute_sync_cache() caller for ->execute_cmd() setup,
    and update IBLOCK + FILEIO backends to use it.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Remove the execute_cmd method in struct se_subsystem_api, and always use the
    one directly in struct se_cmd. To make life simpler for SBC virtual backends
    a struct spc_ops that is passed to sbc_parse_cmd is added. For now it
    only contains an execute_rw member, but more will follow with the subsequent
    commits.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Move the existing code in target_core_cdb.c into the files for the command
    sets that the emulations implement.

    (roland + nab: Squash patch: Fix range calculation in WRITE SAME emulation
    when num blocks == 0s)

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     
  • Instead of trying to handle all SCSI command sets in one function
    (transport_generic_cmd_sequencer) call out to the backend driver to perform
    this functionality. For pSCSI a copy of the existing code is used, but for
    all virtual backends we can use a new parse_sbc_cdb helper is used to
    provide a simple SBC emulation.

    For now this setups means a fair amount of duplication between pSCSI and the
    SBC library, but patches later in this series will sort out that problem.

    (nab: Fix up build failure in target_core_pscsi.c)

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Nicholas Bellinger

    Christoph Hellwig
     

07 May, 2012

3 commits


16 Mar, 2012

1 commit

  • Turns an order-10 allocation into slab-sized ones, thereby preventing
    allocation failures with memory fragmentation.

    This likely saves memory as well, as the slab allocator can pack objects
    more tightly than the buddy allocator.

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

    Jörn Engel
     

18 Jan, 2012

1 commit

  • We need to handle >1 page control cdbs, so extend the code to do a vmap
    if bigger than 1 page. It seems like kmap() is still preferable if just
    a page, fewer TLB shootdowns(?), so keep using that when possible.

    Rename function pair for their new scope.

    Signed-off-by: Andy Grover
    Cc:
    Signed-off-by: Nicholas Bellinger

    Andy Grover
     

14 Dec, 2011

1 commit

  • 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