From 9bcf7bf6168dc5d54f42d8caf18e79d8f8b64ea5 Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Mon, 19 May 2014 07:16:16 +0000 Subject: [PATCH] isert: Fix compilation for old kernels Signed-off-by: Yan Burman git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5531 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 067791c3f..ccf0fe285 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1082,10 +1082,18 @@ void isert_conn_free(struct isert_connection *isert_conn) kref_put(&isert_conn->kref, isert_kref_free); } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +static void isert_conn_closed_do_work(void *ctx) +#else static void isert_conn_closed_do_work(struct work_struct *work) +#endif { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) + struct isert_connection *isert_conn = ctx; +#else struct isert_connection *isert_conn = container_of(work, struct isert_connection, close_work); +#endif /* notify upper layer */ if (!test_bit(ISERT_CONNECTION_ABORTED, &isert_conn->flags)) @@ -1097,7 +1105,7 @@ static void isert_conn_closed_do_work(struct work_struct *work) static void isert_sched_conn_closed(struct isert_connection *isert_conn) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(&isert_conn->close_work, isert_conn_closed_do_work, NULL); + INIT_WORK(&isert_conn->close_work, isert_conn_closed_do_work, isert_conn); #else INIT_WORK(&isert_conn->close_work, isert_conn_closed_do_work); #endif