From 41943ed156dfb8ac4f7be65fdc10d28be99115d4 Mon Sep 17 00:00:00 2001 From: Chesnokov Gleb Date: Sat, 11 Dec 2021 18:56:24 +0300 Subject: [PATCH] iscsi-scst: Remove support for kernel versions before 3.10 The SCST has dropped support for kernels older than 3.10.0 (RHEL 7 / Centos 7) since SCST v3.6. --- iscsi-scst/kernel/config.c | 7 -- iscsi-scst/kernel/conn.c | 25 ------ iscsi-scst/kernel/event.c | 47 ----------- iscsi-scst/kernel/iscsi.c | 22 ------ iscsi-scst/kernel/iscsi.h | 8 -- iscsi-scst/kernel/isert-scst/iser_rdma.c | 91 +--------------------- iscsi-scst/kernel/isert-scst/isert.c | 12 --- iscsi-scst/kernel/isert-scst/isert.h | 4 - iscsi-scst/kernel/isert-scst/isert_login.c | 20 ----- iscsi-scst/kernel/session.c | 2 - 10 files changed, 1 insertion(+), 237 deletions(-) diff --git a/iscsi-scst/kernel/config.c b/iscsi-scst/kernel/config.c index f3a574934..307775fab 100644 --- a/iscsi-scst/kernel/config.c +++ b/iscsi-scst/kernel/config.c @@ -501,10 +501,8 @@ int iscsi_add_attr(struct iscsi_target *target, struct iscsi_attr *tgt_attr; struct list_head *attrs_list; const char *name; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) #ifdef CONFIG_DEBUG_LOCK_ALLOC static struct lock_class_key __key; -#endif #endif TRACE_ENTRY(); @@ -551,13 +549,8 @@ int iscsi_add_attr(struct iscsi_target *target, list_add(&tgt_attr->attrs_list_entry, attrs_list); tgt_attr->attr.attr.name = tgt_attr->name; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35) - tgt_attr->attr.attr.owner = THIS_MODULE; -#endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) #ifdef CONFIG_DEBUG_LOCK_ALLOC tgt_attr->attr.attr.key = &__key; -#endif #endif tgt_attr->attr.attr.mode = attr_info->mode & (S_IRUGO | S_IWUGO); tgt_attr->attr.show = iscsi_attr_show; diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index a27ac0983..031e6c305 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -26,13 +26,11 @@ #include "iscsi.h" #include "digest.h" -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) #if defined(CONFIG_LOCKDEP) && !defined(CONFIG_SCST_PROC) static struct lock_class_key scst_conn_key; static struct lockdep_map scst_conn_dep_map = STATIC_LOCKDEP_MAP_INIT("iscsi_conn_kref", &scst_conn_key); #endif -#endif static int print_conn_state(char *p, size_t size, struct iscsi_conn *conn) { @@ -132,19 +130,10 @@ static ssize_t iscsi_get_target_ip(struct iscsi_conn *conn, switch (sk->sk_family) { case AF_INET: pos = scnprintf(buf, size, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) - "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->saddr)); -#else "%pI4", &inet_sk(sk)->inet_saddr); -#endif break; #ifdef CONFIG_IPV6 case AF_INET6: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) - pos = scnprintf(buf, size, - "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", - NIP6(inet6_sk(sk)->saddr)); -#else #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) pos = scnprintf(buf, size, "[%pI6]", &inet6_sk(sk)->saddr); #else @@ -152,7 +141,6 @@ static ssize_t iscsi_get_target_ip(struct iscsi_conn *conn, #endif #endif break; -#endif default: pos = scnprintf(buf, size, "Unknown family %d", sk->sk_family); @@ -580,18 +568,10 @@ out: return; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void conn_nop_in_delayed_work_fn(void *p) -#else static void conn_nop_in_delayed_work_fn(struct work_struct *work) -#endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - struct iscsi_conn *conn = p; -#else struct iscsi_conn *conn = container_of(work, struct iscsi_conn, nop_in_delayed_work.work); -#endif unsigned long next_timeout = 0; TRACE_ENTRY(); @@ -889,13 +869,8 @@ int iscsi_init_conn(struct iscsi_session *session, conn->conn_thr_pool = session->sess_thr_pool; conn->nop_in_ttt = 0; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) INIT_DELAYED_WORK(&conn->nop_in_delayed_work, conn_nop_in_delayed_work_fn); -#else - INIT_WORK(&conn->nop_in_delayed_work, conn_nop_in_delayed_work_fn, - conn); -#endif conn->last_rcv_time = jiffies; conn->data_rsp_timeout = session->tgt_params.rsp_timeout * HZ; conn->nop_in_interval = session->tgt_params.nop_in_interval * HZ; diff --git a/iscsi-scst/kernel/event.c b/iscsi-scst/kernel/event.c index f8791913f..047cddd48 100644 --- a/iscsi-scst/kernel/event.c +++ b/iscsi-scst/kernel/event.c @@ -49,11 +49,7 @@ static int event_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) { u32 pid; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)) - pid = NETLINK_CB(skb).pid; -#else pid = NETLINK_CB(skb).portid; -#endif WARN_ON(pid == 0); iscsid_pid = pid; @@ -61,11 +57,7 @@ static int event_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) return 0; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) -static int event_recv_skb(struct sk_buff *skb) -#else static void event_recv_skb(struct sk_buff *skb) -#endif { int err; struct nlmsghdr *nlh; @@ -87,27 +79,9 @@ static void event_recv_skb(struct sk_buff *skb) } out: -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) - return 0; -#else return; -#endif } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) -static void event_recv(struct sock *sk, int length) -{ - struct sk_buff *skb; - - while ((skb = skb_dequeue(&sk->sk_receive_queue))) { - if (event_recv_skb(skb) && skb->len) - skb_queue_head(&sk->sk_receive_queue, skb); - else - kfree_skb(skb); - } -} -#endif - /* event_mutex supposed to be held */ static int __event_send(const void *buf, int buf_len) { @@ -196,30 +170,14 @@ int __init event_init(void) { iscsi_net_ns = kobj_ns_grab_current(KOBJ_NS_TYPE_NET); -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22)) - nl = netlink_kernel_create(NETLINK_ISCSI_SCST, 1, event_recv, - THIS_MODULE); -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)) - nl = netlink_kernel_create(NETLINK_ISCSI_SCST, 1, event_recv, NULL, - THIS_MODULE); -#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)) - nl = netlink_kernel_create(iscsi_net_ns, NETLINK_ISCSI_SCST, 1, - event_recv_skb, NULL, THIS_MODULE); -#else { struct netlink_kernel_cfg cfg = { .input = event_recv_skb, .groups = 1, }; -#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0)) - nl = netlink_kernel_create(iscsi_net_ns, NETLINK_ISCSI_SCST, - THIS_MODULE, &cfg); -#else nl = netlink_kernel_create(iscsi_net_ns, NETLINK_ISCSI_SCST, &cfg); -#endif } -#endif if (!nl) goto drop_ns; @@ -234,12 +192,7 @@ drop_ns: void event_exit(void) { -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 24)) - if (nl) - sock_release(nl->sk_socket); -#else netlink_kernel_release(nl); -#endif kobj_ns_drop(KOBJ_NS_TYPE_NET, iscsi_net_ns); iscsi_net_ns = NULL; } diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index 6d1a1e4a4..bb367d10d 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -2469,18 +2469,10 @@ struct iscsi_cmnd_abort_params { static mempool_t *iscsi_cmnd_abort_mempool; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void iscsi_cmnd_abort_fn(void *ctx) -#else static void iscsi_cmnd_abort_fn(struct work_struct *work) -#endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - struct iscsi_cmnd_abort_params *params = ctx; -#else struct iscsi_cmnd_abort_params *params = container_of(work, struct iscsi_cmnd_abort_params, iscsi_cmnd_abort_work); -#endif struct scst_cmd *scst_cmd = params->scst_cmd; struct iscsi_session *session = scst_sess_get_tgt_priv(scst_cmd->sess); struct iscsi_conn *conn; @@ -2540,11 +2532,7 @@ static void iscsi_on_abort_cmd(struct scst_cmd *scst_cmd) } memset(params, 0, sizeof(*params)); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(¶ms->iscsi_cmnd_abort_work, iscsi_cmnd_abort_fn, params); -#else INIT_WORK(¶ms->iscsi_cmnd_abort_work, iscsi_cmnd_abort_fn); -#endif params->scst_cmd = scst_cmd; scst_cmd_get(scst_cmd); @@ -3278,19 +3266,10 @@ static ssize_t iscsi_tcp_get_initiator_ip(struct iscsi_conn *conn, switch (sk->sk_family) { case AF_INET: pos = scnprintf(buf, size, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) - "%u.%u.%u.%u", NIPQUAD(inet_sk(sk)->daddr)); -#else "%pI4", &inet_sk(sk)->inet_daddr); -#endif break; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) case AF_INET6: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) - pos = scnprintf(buf, size, - "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", - NIP6(inet6_sk(sk)->daddr)); -#else #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) pos = scnprintf(buf, size, "[%pI6]", &inet6_sk(sk)->daddr); @@ -3299,7 +3278,6 @@ static ssize_t iscsi_tcp_get_initiator_ip(struct iscsi_conn *conn, #endif #endif break; -#endif default: pos = scnprintf(buf, size, "Unknown family %d", sk->sk_family); diff --git a/iscsi-scst/kernel/iscsi.h b/iscsi-scst/kernel/iscsi.h index 7a5895ec3..dfd61cfce 100644 --- a/iscsi-scst/kernel/iscsi.h +++ b/iscsi-scst/kernel/iscsi.h @@ -130,11 +130,7 @@ struct iscsi_target { }; #define ISCSI_HASH_ORDER 8 -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) #define cmnd_hashfn(itt) hash_32(itt, ISCSI_HASH_ORDER) -#else -#define cmnd_hashfn(itt) hash_long(itt, ISCSI_HASH_ORDER) -#endif struct iscsi_session { struct iscsi_target *target; @@ -315,11 +311,7 @@ struct iscsi_conn { /* Doesn't need any protection */ u16 cid; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) struct delayed_work nop_in_delayed_work; -#else - struct work_struct nop_in_delayed_work; -#endif struct work_struct close_work; unsigned int nop_in_interval; /* in jiffies */ unsigned int nop_in_timeout; /* in jiffies */ diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 311404ef0..bad41bfe7 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -580,18 +580,10 @@ static const char *wr_status_str(enum ib_wc_status status) } } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void isert_discon_do_work(void *ctx) -#else static void isert_discon_do_work(struct work_struct *work) -#endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - struct isert_conn *isert_conn = ctx; -#else struct isert_conn *isert_conn = container_of(work, struct isert_conn, discon_work); -#endif /* notify upper layer */ isert_connection_closed(&isert_conn->iscsi); @@ -599,53 +591,28 @@ static void isert_discon_do_work(struct work_struct *work) static void isert_sched_discon(struct isert_conn *isert_conn) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(&isert_conn->discon_work, isert_discon_do_work, isert_conn); -#else INIT_WORK(&isert_conn->discon_work, isert_discon_do_work); -#endif isert_conn_queue_work(&isert_conn->discon_work); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void isert_conn_drained_do_work(void *ctx) -#else static void isert_conn_drained_do_work(struct work_struct *work) -#endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - struct isert_conn *isert_conn = ctx; -#else struct isert_conn *isert_conn = container_of(work, struct isert_conn, drain_work); -#endif isert_put_conn(isert_conn); } static void isert_sched_conn_drained(struct isert_conn *isert_conn) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(&isert_conn->drain_work, isert_conn_drained_do_work, - isert_conn); -#else INIT_WORK(&isert_conn->drain_work, isert_conn_drained_do_work); -#endif isert_conn_queue_work(&isert_conn->drain_work); } -#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_conn *isert_conn = ctx; -#else struct isert_conn *isert_conn = container_of(work, struct isert_conn, close_work); -#endif if (!test_bit(ISERT_CONNECTION_ABORTED, &isert_conn->flags)) isert_connection_abort(&isert_conn->iscsi); @@ -655,38 +622,21 @@ static void isert_conn_closed_do_work(struct work_struct *work) static void isert_sched_conn_closed(struct isert_conn *isert_conn) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - 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 isert_conn_queue_work(&isert_conn->close_work); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void isert_release_work(void *ctx) -#else static void isert_release_work(struct work_struct *work) -#endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - struct isert_conn *isert_conn = ctx; -#else struct isert_conn *isert_conn = container_of(work, struct isert_conn, release_work); -#endif isert_put_conn(isert_conn); } void isert_sched_conn_free(struct isert_conn *isert_conn) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(&isert_conn->release_work, isert_release_work, isert_conn); -#else INIT_WORK(&isert_conn->release_work, isert_release_work); -#endif isert_conn_queue_work(&isert_conn->release_work); } @@ -789,18 +739,10 @@ static int isert_poll_cq(struct isert_cq *cq) } /* callback function for isert_dev->[cq]->cq_comp_work */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) && \ - !defined(BACKPORT_LINUX_WORKQUEUE_TO_2_6_19) -/* A vanilla 2.6.19 or older kernel without backported OFED kernel headers. */ -static void isert_cq_comp_work_cb(void *ctx) -{ - struct isert_cq *cq_desc = ctx; -#else static void isert_cq_comp_work_cb(struct work_struct *work) { struct isert_cq *cq_desc = container_of(work, struct isert_cq, cq_comp_work); -#endif int ret; TRACE_ENTRY(); @@ -829,12 +771,8 @@ static void isert_cq_comp_handler(struct ib_cq *cq, void *context) { struct isert_cq *cq_desc = context; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - queue_work(cq_desc->cq_workqueue, &cq_desc->cq_comp_work); -#else queue_work_on(smp_processor_id(), cq_desc->cq_workqueue, &cq_desc->cq_comp_work); -#endif } static const char *ib_event_type_str(enum ib_event_type ev_type) @@ -1038,26 +976,12 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev) cq_desc->dev = isert_dev; cq_desc->idx = i; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(&cq_desc->cq_comp_work, isert_cq_comp_work_cb, NULL); -#else INIT_WORK(&cq_desc->cq_comp_work, isert_cq_comp_work_cb); -#endif snprintf(wq_name, sizeof(wq_name), "isert_cq_%p", cq_desc); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) - cq_desc->cq_workqueue = create_singlethread_workqueue(wq_name); -#else -#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 36) - cq_desc->cq_workqueue = alloc_workqueue(wq_name, - WQ_CPU_INTENSIVE| - WQ_RESCUER, 1); -#else cq_desc->cq_workqueue = alloc_workqueue(wq_name, WQ_CPU_INTENSIVE| WQ_MEM_RECLAIM, 1); -#endif -#endif if (unlikely(!cq_desc->cq_workqueue)) { PRINT_ERROR("Failed to alloc iser cq work queue for dev:%s", ib_dev->name); @@ -1160,15 +1084,7 @@ static void isert_device_release(struct isert_device *isert_dev) for (i = 0; i < isert_dev->num_cqs; ++i) { struct isert_cq *cq_desc = &isert_dev->cq_desc[i]; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) - /* - * cancel_work_sync() was introduced in 2.6.22. We can - * only wait until all scheduled work is done. - */ - flush_workqueue(cq_desc->cq_workqueue); -#else cancel_work_sync(&cq_desc->cq_comp_work); -#endif ib_destroy_cq(cq_desc->cq); destroy_workqueue(cq_desc->cq_workqueue); @@ -1810,10 +1726,7 @@ isert_setup_id(struct isert_portal *portal) sa = (struct sockaddr *)&portal->addr; -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0) && \ - (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 <= 5) - id = rdma_create_id(isert_cm_evt_handler, portal, RDMA_PS_TCP); -#elif !RDMA_CREATE_ID_TAKES_NET_ARG +#if !RDMA_CREATE_ID_TAKES_NET_ARG id = rdma_create_id(isert_cm_evt_handler, portal, RDMA_PS_TCP, IB_QPT_RC); #else @@ -1826,7 +1739,6 @@ isert_setup_id(struct isert_portal *portal) goto out; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0) /* * Allow both IPv4 and IPv6 sockets to bind a single port * at the same time. @@ -1836,7 +1748,6 @@ isert_setup_id(struct isert_portal *portal) PRINT_ERROR("Failed to set afonly, err:%d", ret); goto out_id; } -#endif ret = rdma_bind_addr(id, sa); if (ret) { diff --git a/iscsi-scst/kernel/isert-scst/isert.c b/iscsi-scst/kernel/isert-scst/isert.c index 5c2838ec3..0835b2f6e 100644 --- a/iscsi-scst/kernel/isert-scst/isert.c +++ b/iscsi-scst/kernel/isert-scst/isert.c @@ -432,25 +432,13 @@ static ssize_t isert_get_initiator_ip(struct iscsi_conn *conn, switch (ss.ss_family) { case AF_INET: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33) - pos = scnprintf(buf, size, - "%u.%u.%u.%u", - NIPQUAD(((struct sockaddr_in *)&ss)->sin_addr.s_addr)); -#else pos = scnprintf(buf, size, "%pI4", &((struct sockaddr_in *)&ss)->sin_addr.s_addr); -#endif break; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) case AF_INET6: -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) - pos = scnprintf(buf, size, - "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", - NIP6(((struct sockaddr_in6 *)&ss)->sin6_addr)); -#else pos = scnprintf(buf, size, "[%pI6]", &((struct sockaddr_in6 *)&ss)->sin6_addr); -#endif break; #endif default: diff --git a/iscsi-scst/kernel/isert-scst/isert.h b/iscsi-scst/kernel/isert-scst/isert.h index dd541a1b2..9d5600e7a 100644 --- a/iscsi-scst/kernel/isert-scst/isert.h +++ b/iscsi-scst/kernel/isert-scst/isert.h @@ -44,11 +44,7 @@ #include #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37) -#include -#else #include -#endif #ifdef INSIDE_KERNEL_TREE #include diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 60a57bc35..43abc5ad8 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -42,11 +42,7 @@ #ifndef INSIDE_KERNEL_TREE #include #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) #include -#else -#define wait_event_freezable(wq, cond) ({ wait_event(wq, cond); 0; }) -#endif #include #include "isert_dbg.h" #include "../iscsi.h" @@ -119,18 +115,10 @@ static void isert_dev_release(struct isert_conn_dev *dev) mutex_unlock(&isert_listen_dev.conn_lock); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) -static void isert_close_conn_fn(void *ctx) -#else static void isert_close_conn_fn(struct work_struct *work) -#endif { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - struct iscsi_conn *conn = ctx; -#else struct iscsi_conn *conn = container_of(work, struct iscsi_conn, close_work); -#endif isert_close_connection(conn); } @@ -166,11 +154,7 @@ static int add_new_connection(struct isert_listener_dev *dev, goto out; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) - INIT_WORK(&conn->close_work, isert_close_conn_fn, conn); -#else INIT_WORK(&conn->close_work, isert_close_conn_fn); -#endif timer_setup(&conn_dev->tmo_timer, isert_conn_timer_fn, 0); conn_dev->tmo_timer.expires = jiffies + 60 * HZ; @@ -953,9 +937,7 @@ static void __init isert_setup_cdev(struct isert_conn_dev *dev, index); dev->dev = device_create(isert_class, NULL, dev->devno, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) NULL, -#endif ISER_CONN_DEV_PREFIX"%d", index); TRACE_EXIT(); @@ -983,9 +965,7 @@ static void __init isert_setup_listener_cdev(struct isert_listener_dev *dev) PRINT_ERROR("Error %d adding isert_scst", err); dev->dev = device_create(isert_class, NULL, dev->devno, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) NULL, -#endif "isert_scst"); TRACE_EXIT(); diff --git a/iscsi-scst/kernel/session.c b/iscsi-scst/kernel/session.c index 4fb2b037c..1d5d9ca2e 100644 --- a/iscsi-scst/kernel/session.c +++ b/iscsi-scst/kernel/session.c @@ -17,9 +17,7 @@ #ifndef INSIDE_KERNEL_TREE #include #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) #include -#endif #include "iscsi_trace_flag.h" #include "iscsi.h"