aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-04-14 11:08:14 -0400
committerDoug Ledford <dledford@redhat.com>2015-04-15 16:07:12 -0400
commitecc3993a2ad2a4ce8f1a58a08e9177f21015492d (patch)
treeec9a8be87940c5ab655e2d03e2bfe649d6fb9cdb /drivers
parenta065fe6aa25ba6ba93c02dc13486131bb3c64d5f (diff)
IB/iser: Remove redundant cmd_data_len calculation
This code was added before we had protection data length calculation (in iser_send_command), so we needed to calc the sg data length from the sg itself. This is not needed anymore. This patch does not change any functionality. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Adir Lev <adirl@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/ulp/iser/iser_memory.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c
index 341040bf0984..32ccd5cea675 100644
--- a/drivers/infiniband/ulp/iser/iser_memory.c
+++ b/drivers/infiniband/ulp/iser/iser_memory.c
@@ -53,12 +53,9 @@ static int iser_start_rdma_unaligned_sg(struct iscsi_iser_task *iser_task,
53 struct scatterlist *sgl = (struct scatterlist *)data->buf; 53 struct scatterlist *sgl = (struct scatterlist *)data->buf;
54 struct scatterlist *sg; 54 struct scatterlist *sg;
55 char *mem = NULL; 55 char *mem = NULL;
56 unsigned long cmd_data_len = 0; 56 unsigned long cmd_data_len = data->data_len;
57 int dma_nents, i; 57 int dma_nents, i;
58 58
59 for_each_sg(sgl, sg, data->size, i)
60 cmd_data_len += ib_sg_dma_len(dev, sg);
61
62 if (cmd_data_len > ISER_KMALLOC_THRESHOLD) 59 if (cmd_data_len > ISER_KMALLOC_THRESHOLD)
63 mem = (void *)__get_free_pages(GFP_ATOMIC, 60 mem = (void *)__get_free_pages(GFP_ATOMIC,
64 ilog2(roundup_pow_of_two(cmd_data_len)) - PAGE_SHIFT); 61 ilog2(roundup_pow_of_two(cmd_data_len)) - PAGE_SHIFT);