IB/iser: Remove redundant cmd_data_len calculation
authorSagi Grimberg <sagig@mellanox.com>
Tue, 14 Apr 2015 15:08:14 +0000 (18:08 +0300)
committerDoug Ledford <dledford@redhat.com>
Wed, 15 Apr 2015 20:07:12 +0000 (16:07 -0400)
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>
drivers/infiniband/ulp/iser/iser_memory.c

index 341040bf09849d41e4e01c613e0d0e01683fceda..32ccd5cea675988dec35c7590686f481ee6640ae 100644 (file)
@@ -53,12 +53,9 @@ static int iser_start_rdma_unaligned_sg(struct iscsi_iser_task *iser_task,
        struct scatterlist *sgl = (struct scatterlist *)data->buf;
        struct scatterlist *sg;
        char *mem = NULL;
-       unsigned long  cmd_data_len = 0;
+       unsigned long  cmd_data_len = data->data_len;
        int dma_nents, i;
 
-       for_each_sg(sgl, sg, data->size, i)
-               cmd_data_len += ib_sg_dma_len(dev, sg);
-
        if (cmd_data_len > ISER_KMALLOC_THRESHOLD)
                mem = (void *)__get_free_pages(GFP_ATOMIC,
                      ilog2(roundup_pow_of_two(cmd_data_len)) - PAGE_SHIFT);