From 068846965ad3040d637b7060c6e82a6e3eddfc67 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 7 Jun 2011 18:19:50 +0000 Subject: [PATCH] Merge of the trunk's r3438,3488: RHEL5/6 compilation fixes git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.1.0.x@3553 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 12 ++++++++++++ iscsi-scst/kernel/nthread.c | 4 ++-- scst/src/scst_main.c | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index b22e5fa04..285e2d1a2 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -2361,10 +2361,18 @@ 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; @@ -2423,7 +2431,11 @@ 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); diff --git a/iscsi-scst/kernel/nthread.c b/iscsi-scst/kernel/nthread.c index c66678b87..8c316bdcd 100644 --- a/iscsi-scst/kernel/nthread.c +++ b/iscsi-scst/kernel/nthread.c @@ -1085,7 +1085,7 @@ int istrd(void *arg) PRINT_INFO("Read thread for pool %p started, PID %d", p, current->pid); current->flags |= PF_NOFREEZE; -#ifdef RHEL_MAJOR +#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5 rc = set_cpus_allowed(current, p->cpu_mask); #else rc = set_cpus_allowed_ptr(current, &p->cpu_mask); @@ -1856,7 +1856,7 @@ int istwr(void *arg) PRINT_INFO("Write thread for pool %p started, PID %d", p, current->pid); current->flags |= PF_NOFREEZE; -#ifdef RHEL_MAJOR +#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5 rc = set_cpus_allowed(current, p->cpu_mask); #else rc = set_cpus_allowed_ptr(current, &p->cpu_mask); diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index e30ddead7..98706b692 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -1630,7 +1630,7 @@ int scst_add_threads(struct scst_cmd_threads *cmd_threads, * sess->acg can be NULL here, if called from * scst_check_reassign_sess()! */ -#ifdef RHEL_MAJOR +#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 5 rc = set_cpus_allowed(thr->cmd_thread, tgt_dev->acg_dev->acg->acg_cpu_mask); #else