]> git.karo-electronics.de Git - karo-tx-linux.git/commit
target: Simplify fabric sense data length handling
authorRoland Dreier <roland@purestorage.com>
Wed, 15 Aug 2012 21:35:25 +0000 (14:35 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 17 Aug 2012 00:45:54 +0000 (17:45 -0700)
commit867c8e7dae3159215e70a4dc658dff9ae43d0fbf
tree18de35af9f4cc0328829a7f96a0ebec83d42c0f6
parent3ab2a9957d7daa40ce49a35beb9ad21cd6c6bdb4
target: Simplify fabric sense data length handling

Every fabric driver has to supply a se_tfo->set_fabric_sense_len()
method, just so iSCSI can return an offset of 2.  However, every fabric
driver is already allocating a sense buffer and passing it into the
target core, either via transport_init_se_cmd() or target_submit_cmd().

So instead of having iSCSI pass the start of its sense buffer into the
core and then later tell the core to skip the first 2 bytes, it seems
easier for iSCSI just to do the offset of 2 when it passes the sense
buffer into the core.  Then we can drop the se_tfo->set_fabric_sense_len()
everywhere, and just add a couple of lines of code to iSCSI to set the
sense data length to the beginning of the buffer right before it sends
it over the network.

(nab: Remove .set_fabric_sense_len usage from tcm_qla2xxx_npiv_ops)

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
13 files changed:
Documentation/target/tcm_mod_builder.py
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_configfs.c
drivers/target/loopback/tcm_loop.c
drivers/target/sbp/sbp_target.c
drivers/target/target_core_configfs.c
drivers/target/target_core_transport.c
drivers/target/tcm_fc/tfc_conf.c
drivers/usb/gadget/tcm_usb_gadget.c
drivers/vhost/tcm_vhost.c
include/target/target_core_fabric.h