aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_pr.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2012-04-23 11:35:33 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-05-06 18:11:14 -0400
commit6bb35e009b656b36f7985057822c5fbf53ea75b7 (patch)
tree31384150dbd2828ee72a0802efb23692511f032f /drivers/target/target_core_pr.c
parentbd31377878868a47b2d2e6f570fb0cace828555b (diff)
target: replace ->execute_task with ->execute_cmd
Make CDB emulation work on commands instead of tasks again as a preparation of removing tasks completely. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_pr.c')
-rw-r--r--drivers/target/target_core_pr.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 9754819b6042..f5ba98693796 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -193,9 +193,8 @@ static int target_check_scsi2_reservation_conflict(struct se_cmd *cmd)
193 return 0; 193 return 0;
194} 194}
195 195
196int target_scsi2_reservation_release(struct se_task *task) 196int target_scsi2_reservation_release(struct se_cmd *cmd)
197{ 197{
198 struct se_cmd *cmd = task->task_se_cmd;
199 struct se_device *dev = cmd->se_dev; 198 struct se_device *dev = cmd->se_dev;
200 struct se_session *sess = cmd->se_sess; 199 struct se_session *sess = cmd->se_sess;
201 struct se_portal_group *tpg = sess->se_tpg; 200 struct se_portal_group *tpg = sess->se_tpg;
@@ -234,16 +233,13 @@ int target_scsi2_reservation_release(struct se_task *task)
234out_unlock: 233out_unlock:
235 spin_unlock(&dev->dev_reservation_lock); 234 spin_unlock(&dev->dev_reservation_lock);
236out: 235out:
237 if (!ret) { 236 if (!ret)
238 task->task_scsi_status = GOOD; 237 target_complete_cmd(cmd, GOOD);
239 transport_complete_task(task, 1);
240 }
241 return ret; 238 return ret;
242} 239}
243 240
244int target_scsi2_reservation_reserve(struct se_task *task) 241int target_scsi2_reservation_reserve(struct se_cmd *cmd)
245{ 242{
246 struct se_cmd *cmd = task->task_se_cmd;
247 struct se_device *dev = cmd->se_dev; 243 struct se_device *dev = cmd->se_dev;
248 struct se_session *sess = cmd->se_sess; 244 struct se_session *sess = cmd->se_sess;
249 struct se_portal_group *tpg = sess->se_tpg; 245 struct se_portal_group *tpg = sess->se_tpg;
@@ -304,10 +300,8 @@ int target_scsi2_reservation_reserve(struct se_task *task)
304out_unlock: 300out_unlock:
305 spin_unlock(&dev->dev_reservation_lock); 301 spin_unlock(&dev->dev_reservation_lock);
306out: 302out:
307 if (!ret) { 303 if (!ret)
308 task->task_scsi_status = GOOD; 304 target_complete_cmd(cmd, GOOD);
309 transport_complete_task(task, 1);
310 }
311 return ret; 305 return ret;
312} 306}
313 307
@@ -3798,9 +3792,8 @@ static unsigned long long core_scsi3_extract_reservation_key(unsigned char *cdb)
3798/* 3792/*
3799 * See spc4r17 section 6.14 Table 170 3793 * See spc4r17 section 6.14 Table 170
3800 */ 3794 */
3801int target_scsi3_emulate_pr_out(struct se_task *task) 3795int target_scsi3_emulate_pr_out(struct se_cmd *cmd)
3802{ 3796{
3803 struct se_cmd *cmd = task->task_se_cmd;
3804 unsigned char *cdb = &cmd->t_task_cdb[0]; 3797 unsigned char *cdb = &cmd->t_task_cdb[0];
3805 unsigned char *buf; 3798 unsigned char *buf;
3806 u64 res_key, sa_res_key; 3799 u64 res_key, sa_res_key;
@@ -3940,10 +3933,8 @@ int target_scsi3_emulate_pr_out(struct se_task *task)
3940 } 3933 }
3941 3934
3942out: 3935out:
3943 if (!ret) { 3936 if (!ret)
3944 task->task_scsi_status = GOOD; 3937 target_complete_cmd(cmd, GOOD);
3945 transport_complete_task(task, 1);
3946 }
3947 return ret; 3938 return ret;
3948} 3939}
3949 3940
@@ -4298,9 +4289,8 @@ static int core_scsi3_pri_read_full_status(struct se_cmd *cmd)
4298 return 0; 4289 return 0;
4299} 4290}
4300 4291
4301int target_scsi3_emulate_pr_in(struct se_task *task) 4292int target_scsi3_emulate_pr_in(struct se_cmd *cmd)
4302{ 4293{
4303 struct se_cmd *cmd = task->task_se_cmd;
4304 int ret; 4294 int ret;
4305 4295
4306 /* 4296 /*
@@ -4341,10 +4331,8 @@ int target_scsi3_emulate_pr_in(struct se_task *task)
4341 break; 4331 break;
4342 } 4332 }
4343 4333
4344 if (!ret) { 4334 if (!ret)
4345 task->task_scsi_status = GOOD; 4335 target_complete_cmd(cmd, GOOD);
4346 transport_complete_task(task, 1);
4347 }
4348 return ret; 4336 return ret;
4349} 4337}
4350 4338