From 6c0a869007321cb10fb1514ea01f6fe267400982 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 14 Jul 2015 23:57:42 +0000 Subject: [PATCH] isert-scst: Linux kernel v4.2 ib_create_cq() build fix git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6427 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index f7f59dd51..f56ef3286 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -871,12 +871,26 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev) goto fail_cq; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) cq = ib_create_cq(ib_dev, isert_cq_comp_handler, isert_async_evt_handler, cq_desc, /* context */ cqe_num, i); /* completion vector */ +#else + { + struct ib_cq_init_attr ia = { + .cqe = cqe_num, + .comp_vector = i, + }; + cq = ib_create_cq(ib_dev, + isert_cq_comp_handler, + isert_async_evt_handler, + cq_desc, /* context */ + &ia); + } +#endif if (unlikely(IS_ERR(cq))) { cq_desc->cq = NULL; err = PTR_ERR(cq);