aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_file.c
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2011-07-19 06:26:37 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 05:37:43 -0400
commit5951146dea1ac8ff2f177477c907084d63913cad (patch)
tree699cb7c498ca1799ae3e349cb4360171d9fa63e0 /drivers/target/target_core_file.c
parentf22c119683e73498d8126581a1be75e1b7a339a3 (diff)
target: More core cleanups from AGrover (round 2)
This patch contains the squashed version of second round of target core cleanups and simplifications and Andy and Co. It also contains a handful of fixes to address bugs the original series and other minor cleanups. Here is the condensed shortlog: target: Remove unneeded casts to void* target: Rename get_lun_for_{cmd,tmr} to lookup_{cmd,tmr}_lun target: Make t_task a member of se_cmd, not a pointer target: Handle functions returning "-2" target: Use cmd->se_dev over cmd->se_lun->lun_se_dev target: Embed qr in struct se_cmd target: Replace embedded struct se_queue_req with a list_head target: Rename list_heads that are nodes in struct se_cmd to "*_node" target: Fold transport_device_setup_cmd() into lookup_{tmr,cmd}_lun() target: Make t_mem_list and t_mem_list_bidi members of t_task target: Add comment & cleanup transport_map_sg_to_mem() target: Remove unneeded checks in transport_free_pages() (Roland: Fix se_queue_req removal leftovers OOPs) (nab: Fix transport_lookup_tmr_lun failure case) (nab: Fix list_empty(&cmd->t_task.t_mem_bidi_list) inversion bugs) Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_file.c')
-rw-r--r--drivers/target/target_core_file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 0c44bc051484..2e7ea7457501 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -223,7 +223,7 @@ static struct se_device *fd_create_virtdevice(
223 dev_limits.queue_depth = FD_DEVICE_QUEUE_DEPTH; 223 dev_limits.queue_depth = FD_DEVICE_QUEUE_DEPTH;
224 224
225 dev = transport_add_device_to_core_hba(hba, &fileio_template, 225 dev = transport_add_device_to_core_hba(hba, &fileio_template,
226 se_dev, dev_flags, (void *)fd_dev, 226 se_dev, dev_flags, fd_dev,
227 &dev_limits, "FILEIO", FD_VERSION); 227 &dev_limits, "FILEIO", FD_VERSION);
228 if (!(dev)) 228 if (!(dev))
229 goto fail; 229 goto fail;
@@ -279,7 +279,7 @@ fd_alloc_task(struct se_cmd *cmd)
279 return NULL; 279 return NULL;
280 } 280 }
281 281
282 fd_req->fd_dev = cmd->se_lun->lun_se_dev->dev_ptr; 282 fd_req->fd_dev = cmd->se_dev->dev_ptr;
283 283
284 return &fd_req->fd_task; 284 return &fd_req->fd_task;
285} 285}
@@ -377,7 +377,7 @@ static void fd_emulate_sync_cache(struct se_task *task)
377 struct se_cmd *cmd = task->task_se_cmd; 377 struct se_cmd *cmd = task->task_se_cmd;
378 struct se_device *dev = cmd->se_dev; 378 struct se_device *dev = cmd->se_dev;
379 struct fd_dev *fd_dev = dev->dev_ptr; 379 struct fd_dev *fd_dev = dev->dev_ptr;
380 int immed = (cmd->t_task->t_task_cdb[1] & 0x2); 380 int immed = (cmd->t_task.t_task_cdb[1] & 0x2);
381 loff_t start, end; 381 loff_t start, end;
382 int ret; 382 int ret;
383 383
@@ -391,11 +391,11 @@ static void fd_emulate_sync_cache(struct se_task *task)
391 /* 391 /*
392 * Determine if we will be flushing the entire device. 392 * Determine if we will be flushing the entire device.
393 */ 393 */
394 if (cmd->t_task->t_task_lba == 0 && cmd->data_length == 0) { 394 if (cmd->t_task.t_task_lba == 0 && cmd->data_length == 0) {
395 start = 0; 395 start = 0;
396 end = LLONG_MAX; 396 end = LLONG_MAX;
397 } else { 397 } else {
398 start = cmd->t_task->t_task_lba * dev->se_sub_dev->se_dev_attrib.block_size; 398 start = cmd->t_task.t_task_lba * dev->se_sub_dev->se_dev_attrib.block_size;
399 if (cmd->data_length) 399 if (cmd->data_length)
400 end = start + cmd->data_length; 400 end = start + cmd->data_length;
401 else 401 else
@@ -475,7 +475,7 @@ static int fd_do_task(struct se_task *task)
475 if (ret > 0 && 475 if (ret > 0 &&
476 dev->se_sub_dev->se_dev_attrib.emulate_write_cache > 0 && 476 dev->se_sub_dev->se_dev_attrib.emulate_write_cache > 0 &&
477 dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 && 477 dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 &&
478 cmd->t_task->t_tasks_fua) { 478 cmd->t_task.t_tasks_fua) {
479 /* 479 /*
480 * We might need to be a bit smarter here 480 * We might need to be a bit smarter here
481 * and return some sense data to let the initiator 481 * and return some sense data to let the initiator