aboutsummaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2011-07-20 15:28:46 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2011-07-22 05:37:48 -0400
commitec98f7825c6eaa4a9afb0eb518826efc8a2ed4a2 (patch)
treeb4ccee24db5d7d54ccfa5e3be2441d3a4e37f295 /include/target
parent3a86720567fd92819b449df10db85a2f73447d87 (diff)
target: Eliminate usage of struct se_mem
Both backstores and fabrics use arrays of struct scatterlist to describe data buffers. However TCM used struct se_mems, basically a linked list of scatterlist entries. We are able to simplify the code by eliminating this intermediate data structure and just using struct scatterlist[] throughout. Also, moved attachment of task to cmd out of transport_generic_get_task and into allocate_control_task and allocate_data_tasks. The reasoning is that it's nonintuitive that get_task should automatically add it to the cmd's task list -- it should just return an allocated, initialized task. That's all it should do, based on the function's name, so either the function shouldn't do it, or the name should change to encapsulate the entire essence of what it does. (nab: Fix compile warnings in tcm_fc, and make transport_kmap_first_data_page honor sg->offset for SGLs from contigious memory with TCM_Loop, and fix control se_cmd descriptor memory leak) Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r--include/target/target_core_base.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index d97618a2ee95..465f266a0205 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -490,8 +490,6 @@ struct se_cmd {
490 int t_tasks_failed; 490 int t_tasks_failed;
491 int t_tasks_fua; 491 int t_tasks_fua;
492 bool t_tasks_bidi; 492 bool t_tasks_bidi;
493 u32 t_tasks_se_num;
494 u32 t_tasks_se_bidi_num;
495 u32 t_tasks_sg_chained_no; 493 u32 t_tasks_sg_chained_no;
496 atomic_t t_fe_count; 494 atomic_t t_fe_count;
497 atomic_t t_se_count; 495 atomic_t t_se_count;
@@ -523,9 +521,13 @@ struct se_cmd {
523 */ 521 */
524 struct scatterlist *t_task_pt_sgl; 522 struct scatterlist *t_task_pt_sgl;
525 u32 t_task_pt_sgl_num; 523 u32 t_task_pt_sgl_num;
526 struct list_head t_mem_list; 524
525 struct scatterlist *t_data_sg;
526 unsigned int t_data_nents;
527 struct scatterlist *t_bidi_data_sg;
528 unsigned int t_bidi_data_nents;
529
527 /* Used for BIDI READ */ 530 /* Used for BIDI READ */
528 struct list_head t_mem_bidi_list;
529 struct list_head t_task_list; 531 struct list_head t_task_list;
530 u32 t_task_list_num; 532 u32 t_task_list_num;
531 533