aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_aux.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_aux.c')
-rw-r--r--drivers/s390/scsi/zfcp_aux.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c
index d9e7be979760..00118499018b 100644
--- a/drivers/s390/scsi/zfcp_aux.c
+++ b/drivers/s390/scsi/zfcp_aux.c
@@ -562,8 +562,6 @@ zfcp_sg_list_alloc(struct zfcp_sg_list *sg_list, size_t size)
562 sg_init_table(sg_list->sg, sg_list->count); 562 sg_init_table(sg_list->sg, sg_list->count);
563 563
564 for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) { 564 for (i = 0, sg = sg_list->sg; i < sg_list->count; i++, sg++) {
565 sg->length = min(size, PAGE_SIZE);
566 sg->offset = 0;
567 address = (void *) get_zeroed_page(GFP_KERNEL); 565 address = (void *) get_zeroed_page(GFP_KERNEL);
568 if (address == NULL) { 566 if (address == NULL) {
569 sg_list->count = i; 567 sg_list->count = i;
@@ -571,7 +569,7 @@ zfcp_sg_list_alloc(struct zfcp_sg_list *sg_list, size_t size)
571 retval = -ENOMEM; 569 retval = -ENOMEM;
572 goto out; 570 goto out;
573 } 571 }
574 zfcp_address_to_sg(address, sg); 572 zfcp_address_to_sg(address, sg, min(size, PAGE_SIZE));
575 size -= sg->length; 573 size -= sg->length;
576 } 574 }
577 575
@@ -1523,10 +1521,8 @@ zfcp_gid_pn_buffers_alloc(struct zfcp_gid_pn_data **gid_pn, mempool_t *pool)
1523 data->ct.req = &data->req; 1521 data->ct.req = &data->req;
1524 data->ct.resp = &data->resp; 1522 data->ct.resp = &data->resp;
1525 data->ct.req_count = data->ct.resp_count = 1; 1523 data->ct.req_count = data->ct.resp_count = 1;
1526 zfcp_address_to_sg(&data->ct_iu_req, &data->req); 1524 zfcp_address_to_sg(&data->ct_iu_req, &data->req, sizeof(struct ct_iu_gid_pn_req));
1527 zfcp_address_to_sg(&data->ct_iu_resp, &data->resp); 1525 zfcp_address_to_sg(&data->ct_iu_resp, &data->resp, sizeof(struct ct_iu_gid_pn_resp));
1528 data->req.length = sizeof(struct ct_iu_gid_pn_req);
1529 data->resp.length = sizeof(struct ct_iu_gid_pn_resp);
1530 1526
1531 *gid_pn = data; 1527 *gid_pn = data;
1532 return 0; 1528 return 0;