diff options
author | Andy Grover <agrover@redhat.com> | 2011-05-03 04:12:10 +0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-07-22 13:37:44 +0400 |
commit | a1d8b49abd60ba5d09e7c968731abcb0f8f1cbf6 (patch) | |
tree | 8cbfd54b4829fd5f0ed206e15c81c1e626e7701d /drivers/target/tcm_fc/tfc_io.c | |
parent | dd3a5ad8e0c8706659f02c4a72b8c87f6f7ab479 (diff) | |
download | linux-a1d8b49abd60ba5d09e7c968731abcb0f8f1cbf6.tar.xz |
target: Updates from AGrover and HCH (round 3)
This patch contains a squashed version of third round series cleanups,
improvements ,and simplfications from Andy and Christoph ahead of the
heavy lifting between round 3 -> 4 for the target core SGL conversion.
This include cleanups to the main target I/O path and other miscellaneous
updates.
target: Replace custom sg<->buf functions with lib funcs
target: Simplify sector limiting code
target: get_cdb should never return NULL
target: Simplify transport_memcpy_se_mem_read_contig
target: Use assignment rather than increment for t_task_cdbs
target: Don't pass dma_size to generic_get_mem
target: Pass sg with type scatterlist in transport_map_sg_to_mem
target: Move task_sg_num next to task_sg in struct se_task
target: inline struct se_transport_task into struct se_cmd
target: Change name & semantics of transport_get_sectors()
target: Remove unused members of se_cmd
target: Rename se_cmd.t_task_cdbs to t_task_list_num
target: Fix some spelling
target: Remove unused var from transport_generic_do_tmr
target: map_sg_to_mem: return sg_count in return value
target/pscsi: Use min_t for sector limits
target/pscsi: Unused param for pscsi_get_bio()
target: Rename get_cdb_count to allocate_tasks
target: Make transport_generic_new_cmd() available for iscsi-target
target: Remove fabric callback to allocate iovecs
target: Fix transport_generic_new_cmd WRITE comment
(hch: Use __GFP_ZERO usage for alloc_pages() usage)
Signed-off-by: Andy Grover <agrover@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/tcm_fc/tfc_io.c')
-rw-r--r-- | drivers/target/tcm_fc/tfc_io.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c index f18af6e99b83..8560182f0dad 100644 --- a/drivers/target/tcm_fc/tfc_io.c +++ b/drivers/target/tcm_fc/tfc_io.c @@ -65,7 +65,6 @@ int ft_queue_data_in(struct se_cmd *se_cmd) { struct ft_cmd *cmd = container_of(se_cmd, struct ft_cmd, se_cmd); - struct se_transport_task *task; struct fc_frame *fp = NULL; struct fc_exch *ep; struct fc_lport *lport; @@ -90,14 +89,13 @@ int ft_queue_data_in(struct se_cmd *se_cmd) lport = ep->lp; cmd->seq = lport->tt.seq_start_next(cmd->seq); - task = &se_cmd->t_task; remaining = se_cmd->data_length; /* * Setup to use first mem list entry if any. */ - if (task->t_tasks_se_num) { - mem = list_first_entry(&task->t_mem_list, + if (se_cmd->t_tasks_se_num) { + mem = list_first_entry(&se_cmd->t_mem_list, struct se_mem, se_list); mem_len = mem->se_len; mem_off = mem->se_off; @@ -148,8 +146,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd) if (use_sg) { if (!mem) { - BUG_ON(!task->t_task_buf); - page_addr = task->t_task_buf + mem_off; + BUG_ON(!se_cmd->t_task_buf); + page_addr = se_cmd->t_task_buf + mem_off; /* * In this case, offset is 'offset_in_page' of * (t_task_buf + mem_off) instead of 'mem_off'. @@ -180,7 +178,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd) kunmap_atomic(page_addr, KM_SOFTIRQ0); to += tlen; } else { - from = task->t_task_buf + mem_off; + from = se_cmd->t_task_buf + mem_off; memcpy(to, from, tlen); to += tlen; } @@ -220,7 +218,6 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp) struct fc_seq *seq = cmd->seq; struct fc_exch *ep; struct fc_lport *lport; - struct se_transport_task *task; struct fc_frame_header *fh; struct se_mem *mem; u32 mem_off; @@ -235,8 +232,6 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp) u32 f_ctl; void *buf; - task = &se_cmd->t_task; - fh = fc_frame_header_get(fp); if (!(ntoh24(fh->fh_f_ctl) & FC_FC_REL_OFF)) goto drop; @@ -312,8 +307,8 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp) /* * Setup to use first mem list entry if any. */ - if (task->t_tasks_se_num) { - mem = list_first_entry(&task->t_mem_list, + if (se_cmd->t_tasks_se_num) { + mem = list_first_entry(&se_cmd->t_mem_list, struct se_mem, se_list); mem_len = mem->se_len; mem_off = mem->se_off; @@ -355,7 +350,7 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp) memcpy(to, from, tlen); kunmap_atomic(page_addr, KM_SOFTIRQ0); } else { - to = task->t_task_buf + mem_off; + to = se_cmd->t_task_buf + mem_off; memcpy(to, from, tlen); } from += tlen; |