aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-01-12 21:23:26 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-01-12 21:23:26 -0500
commitfb43bd08af2f992794bf2867112a5225d45183ec (patch)
tree1204ef7a46479718ffed935a81b04cd9f868464f /drivers/vhost
parent721c21c17ab958abf19a8fc611c3bd4743680e38 (diff)
parent8060b8dd4526bd4897e7a4207016a30a8fd99293 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull scsi target fixes from Nicholas Bellinger: "Mostly minor fixes this time, including: - Add missing virtio-scsi -> TCM attribute conversion in vhost-scsi. - Fix persistent reservations write exclusive handling to allow readers for all registered I_T nexuses. - Drop arbitrary maximum I/O size limit in order to process I/Os larger than 4 MB, required for initiators that don't honor block limits EVPD. - Drop the now left-over fabric_max_sectors attribute" * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: iscsi-target: Fix typos in enum cmd_flags_table MAINTAINERS: Add entry for iSER target driver target: Allow Write Exclusive non-reservation holders to READ target: Drop left-over fabric_max_sectors attribute target: Drop arbitrary maximum I/O size limit Documentation/target: Update fabric_ops to latest code vhost-scsi: Add missing virtio-scsi -> TCM attribute conversion
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/scsi.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 01c01cb3933f..d695b1673ae5 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -911,6 +911,23 @@ vhost_scsi_map_iov_to_prot(struct tcm_vhost_cmd *cmd,
911 return 0; 911 return 0;
912} 912}
913 913
914static int vhost_scsi_to_tcm_attr(int attr)
915{
916 switch (attr) {
917 case VIRTIO_SCSI_S_SIMPLE:
918 return TCM_SIMPLE_TAG;
919 case VIRTIO_SCSI_S_ORDERED:
920 return TCM_ORDERED_TAG;
921 case VIRTIO_SCSI_S_HEAD:
922 return TCM_HEAD_TAG;
923 case VIRTIO_SCSI_S_ACA:
924 return TCM_ACA_TAG;
925 default:
926 break;
927 }
928 return TCM_SIMPLE_TAG;
929}
930
914static void tcm_vhost_submission_work(struct work_struct *work) 931static void tcm_vhost_submission_work(struct work_struct *work)
915{ 932{
916 struct tcm_vhost_cmd *cmd = 933 struct tcm_vhost_cmd *cmd =
@@ -936,9 +953,10 @@ static void tcm_vhost_submission_work(struct work_struct *work)
936 rc = target_submit_cmd_map_sgls(se_cmd, tv_nexus->tvn_se_sess, 953 rc = target_submit_cmd_map_sgls(se_cmd, tv_nexus->tvn_se_sess,
937 cmd->tvc_cdb, &cmd->tvc_sense_buf[0], 954 cmd->tvc_cdb, &cmd->tvc_sense_buf[0],
938 cmd->tvc_lun, cmd->tvc_exp_data_len, 955 cmd->tvc_lun, cmd->tvc_exp_data_len,
939 cmd->tvc_task_attr, cmd->tvc_data_direction, 956 vhost_scsi_to_tcm_attr(cmd->tvc_task_attr),
940 TARGET_SCF_ACK_KREF, sg_ptr, cmd->tvc_sgl_count, 957 cmd->tvc_data_direction, TARGET_SCF_ACK_KREF,
941 NULL, 0, sg_prot_ptr, cmd->tvc_prot_sgl_count); 958 sg_ptr, cmd->tvc_sgl_count, NULL, 0, sg_prot_ptr,
959 cmd->tvc_prot_sgl_count);
942 if (rc < 0) { 960 if (rc < 0) {
943 transport_send_check_condition_and_sense(se_cmd, 961 transport_send_check_condition_and_sense(se_cmd,
944 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0); 962 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0);