aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/loopback
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r--drivers/target/loopback/tcm_loop.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 3df1c9b8ae6..cbf5e451374 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -148,22 +148,8 @@ static int tcm_loop_new_cmd_map(struct se_cmd *se_cmd)
148 * Allocate the necessary tasks to complete the received CDB+data 148 * Allocate the necessary tasks to complete the received CDB+data
149 */ 149 */
150 ret = transport_generic_allocate_tasks(se_cmd, sc->cmnd); 150 ret = transport_generic_allocate_tasks(se_cmd, sc->cmnd);
151 if (ret == -ENOMEM) { 151 if (ret != 0)
152 /* Out of Resources */ 152 return ret;
153 return PYX_TRANSPORT_LU_COMM_FAILURE;
154 } else if (ret == -EINVAL) {
155 /*
156 * Handle case for SAM_STAT_RESERVATION_CONFLICT
157 */
158 if (se_cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT)
159 return PYX_TRANSPORT_RESERVATION_CONFLICT;
160 /*
161 * Otherwise, return SAM_STAT_CHECK_CONDITION and return
162 * sense data.
163 */
164 return PYX_TRANSPORT_USE_SENSE_REASON;
165 }
166
167 /* 153 /*
168 * For BIDI commands, pass in the extra READ buffer 154 * For BIDI commands, pass in the extra READ buffer
169 * to transport_generic_map_mem_to_cmd() below.. 155 * to transport_generic_map_mem_to_cmd() below..
@@ -194,12 +180,8 @@ static int tcm_loop_new_cmd_map(struct se_cmd *se_cmd)
194 } 180 }
195 181
196 /* Tell the core about our preallocated memory */ 182 /* Tell the core about our preallocated memory */
197 ret = transport_generic_map_mem_to_cmd(se_cmd, scsi_sglist(sc), 183 return transport_generic_map_mem_to_cmd(se_cmd, scsi_sglist(sc),
198 scsi_sg_count(sc), sgl_bidi, sgl_bidi_count); 184 scsi_sg_count(sc), sgl_bidi, sgl_bidi_count);
199 if (ret < 0)
200 return PYX_TRANSPORT_LU_COMM_FAILURE;
201
202 return 0;
203} 185}
204 186
205/* 187/*