summaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_rd.c
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2011-07-19 10:26:37 +0000
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 09:37:43 +0000
commit5951146dea1ac8ff2f177477c907084d63913cad (patch)
tree699cb7c498ca1799ae3e349cb4360171d9fa63e0 /drivers/target/target_core_rd.c
parentf22c119683e73498d8126581a1be75e1b7a339a3 (diff)
downloadlinux-5951146dea1ac8ff2f177477c907084d63913cad.tar.bz2
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_rd.c')
-rw-r--r--drivers/target/target_core_rd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index fbf06c3994fd..384a8e2083e3 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -66,7 +66,7 @@ static int rd_attach_hba(struct se_hba *hba, u32 host_id)
rd_host->rd_host_id = host_id;
- hba->hba_ptr = (void *) rd_host;
+ hba->hba_ptr = rd_host;
printk(KERN_INFO "CORE_HBA[%d] - TCM Ramdisk HBA Driver %s on"
" Generic Target Core Stack %s\n", hba->hba_id,
@@ -271,7 +271,7 @@ static struct se_device *rd_create_virtdevice(
dev = transport_add_device_to_core_hba(hba,
(rd_dev->rd_direct) ? &rd_dr_template :
- &rd_mcp_template, se_dev, dev_flags, (void *)rd_dev,
+ &rd_mcp_template, se_dev, dev_flags, rd_dev,
&dev_limits, prod, rev);
if (!(dev))
goto fail;
@@ -336,7 +336,7 @@ rd_alloc_task(struct se_cmd *cmd)
printk(KERN_ERR "Unable to allocate struct rd_request\n");
return NULL;
}
- rd_req->rd_dev = cmd->se_lun->lun_se_dev->dev_ptr;
+ rd_req->rd_dev = cmd->se_dev->dev_ptr;
return &rd_req->rd_task;
}
@@ -737,7 +737,7 @@ check_eot:
}
out:
- task->task_se_cmd->t_task->t_tasks_se_num += *se_mem_cnt;
+ task->task_se_cmd->t_task.t_tasks_se_num += *se_mem_cnt;
#ifdef DEBUG_RAMDISK_DR
printk(KERN_INFO "RD_DR - Allocated %u struct se_mem segments for task\n",
*se_mem_cnt);
@@ -819,7 +819,7 @@ static int rd_DIRECT_without_offset(
}
out:
- task->task_se_cmd->t_task->t_tasks_se_num += *se_mem_cnt;
+ task->task_se_cmd->t_task.t_tasks_se_num += *se_mem_cnt;
#ifdef DEBUG_RAMDISK_DR
printk(KERN_INFO "RD_DR - Allocated %u struct se_mem segments for task\n",
*se_mem_cnt);
@@ -880,14 +880,14 @@ static int rd_DIRECT_do_se_mem_map(
* across multiple struct se_task->task_sg[].
*/
ret = transport_init_task_sg(task,
- list_entry(cmd->t_task->t_mem_list->next,
+ list_first_entry(&cmd->t_task.t_mem_list,
struct se_mem, se_list),
task_offset);
if (ret <= 0)
return ret;
return transport_map_mem_to_sg(task, se_mem_list, task->task_sg,
- list_entry(cmd->t_task->t_mem_list->next,
+ list_first_entry(&cmd->t_task.t_mem_list,
struct se_mem, se_list),
out_se_mem, se_mem_cnt, task_offset_in);
}