From 2f9f473cde13d9463c433813d068f954d78deba5 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 24 Mar 2009 10:43:55 +0000 Subject: [PATCH] - Fixes broken build if io_context patch not applied - #warning's cleanup git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@715 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 8 ++++---- scst/src/dev_handlers/scst_user.c | 8 ++++---- scst/src/scst_lib.c | 8 -------- scst/src/scst_main.c | 23 ++++++++++------------- scst/src/scst_priv.h | 24 ++++++++++++++++-------- scst_local/scst_local.c | 8 ++++---- 6 files changed, 38 insertions(+), 41 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index eeafbe555..3ff334c49 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -24,10 +24,10 @@ #include "digest.h" #if !defined(CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION) -#warning "Patch put_page_callback-.patch not applied on your \ - kernel or CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION \ - config option not set. ISCSI-SCST will be working with not the best \ - performance. Refer README file for details." +#warning "Patch put_page_callback-.patch not applied on your\ + kernel or CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION\ + config option not set. ISCSI-SCST will be working with not the best\ + performance. Refer README file for details." #endif #define ISCSI_INIT_WRITE_WAKE 0x1 diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 505b6b5ee..842c14ccf 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -29,10 +29,10 @@ #include "scst_dev_handler.h" #if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G) -#warning "HIGHMEM kernel configurations are not supported by this module, \ - because nowadays it doesn't worth the effort. Consider changing \ - VMSPLIT option or use a 64-bit configuration instead. See README file \ - for details." +#warning "HIGHMEM kernel configurations are not supported by this module,\ + because nowadays it doesn't worth the effort. Consider changing\ + VMSPLIT option or use a 64-bit configuration instead. See README file\ + for details." #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 6f299b7f8..51c405344 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -794,11 +794,7 @@ void scst_free_device(struct scst_device *dev) } #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) __exit_io_context(dev->dev_io_ctx); -#endif -#endif kfree(dev); @@ -1173,11 +1169,7 @@ static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev) scst_del_global_threads(vtt->threads_num); } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) __exit_io_context(tgt_dev->tgt_dev_io_ctx); -#endif -#endif kmem_cache_free(scst_tgtd_cachep, tgt_dev); diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index f40d2834c..7912c20de 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -34,23 +34,23 @@ #include "scst_mem.h" #if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G) -#warning "HIGHMEM kernel configurations are fully supported, but not \ - recommended for performance reasons. Consider changing VMSPLIT \ - option or use a 64-bit configuration instead. See README file for \ - details." +#warning "HIGHMEM kernel configurations are fully supported, but not\ + recommended for performance reasons. Consider changing VMSPLIT\ + option or use a 64-bit configuration instead. See README file for\ + details." #endif #if !defined(SCSI_EXEC_REQ_FIFO_DEFINED) && \ !defined(CONFIG_SCST_STRICT_SERIALIZING) -#warning "Patch scst_exec_req_fifo-.patch was not applied on \ - your kernel and CONFIG_SCST_STRICT_SERIALIZING isn't defined. \ - Pass-through dev handlers will not be supported." +#warning "Patch scst_exec_req_fifo-.patch was not applied on\ + your kernel and CONFIG_SCST_STRICT_SERIALIZING isn't defined.\ + Pass-through dev handlers will not work." #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) #if !defined(SCST_IO_CONTEXT) -#warning "Patch io_context-.patch was not applied \ - on your kernel. SCST will be working with not the best performance." +#warning "Patch io_context-.patch was not applied\ + on your kernel. SCST will be working with not the best performance." #endif #endif @@ -1128,8 +1128,6 @@ int scst_add_dev_threads(struct scst_device *dev, int num) list_add(&thr->thread_list_entry, &dev->threads_list); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) /* * ToDo: better to use tgt_dev_io_context instead, but we * are not ready for that yet. @@ -1138,8 +1136,7 @@ int scst_add_dev_threads(struct scst_device *dev, int num) thr->cmd_thread->io_context = ioc_task_link(dev->dev_io_ctx); TRACE_DBG("Setting dev io ctx %p on thr %d", dev->dev_io_ctx, thr->cmd_thread->pid); -#endif -#endif + wake_up_process(thr->cmd_thread); } diff --git a/scst/src/scst_priv.h b/scst/src/scst_priv.h index 58edb6a7e..f64bd31fe 100644 --- a/scst/src/scst_priv.h +++ b/scst/src/scst_priv.h @@ -177,10 +177,10 @@ struct scst_cmd_thread_t { struct list_head thread_list_entry; }; +#if defined(SCST_IO_CONTEXT) + static inline void scst_set_io_context(struct scst_tgt_dev *tgt_dev) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) if (tgt_dev->dev->p_cmd_lists == &scst_main_cmd_lists) { EXTRACHECKS_BUG_ON(current->io_context); /* @@ -190,22 +190,30 @@ static inline void scst_set_io_context(struct scst_tgt_dev *tgt_dev) current->io_context = tgt_dev->tgt_dev_io_ctx; TRACE_DBG("io_context %p", tgt_dev->tgt_dev_io_ctx); } -#endif -#endif } static inline void scst_reset_io_context(struct scst_tgt_dev *tgt_dev) { -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) -#if defined(CONFIG_BLOCK) && defined(SCST_IO_CONTEXT) if (current->io_context == tgt_dev->tgt_dev_io_ctx) { current->io_context = NULL; TRACE_DBG("io_context %p reset", tgt_dev->tgt_dev_io_ctx); } -#endif -#endif } +#else + +static inline void scst_set_io_context(struct scst_tgt_dev *tgt_dev) {} +static inline void scst_reset_io_context(struct scst_tgt_dev *tgt_dev) {} +static inline void __exit_io_context(struct io_context *ioc) {} +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25) +static inline struct io_context *ioc_task_link(struct io_context *ioc) +{ + return NULL; +}; +#endif + +#endif + extern struct mutex scst_global_threads_mutex; extern u32 scst_nr_global_threads; diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index c045b2eee..7f67d1530 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -48,10 +48,10 @@ #endif #if defined(CONFIG_HIGHMEM4G) || defined(CONFIG_HIGHMEM64G) -#warning "HIGHMEM kernel configurations are not supported by this module, \ - because nowadays it isn't worth the effort. Consider changing \ - VMSPLIT option or use a 64-bit configuration instead. See SCST core \ - README file for details." +#warning "HIGHMEM kernel configurations are not supported by this module,\ + because nowadays it isn't worth the effort. Consider changing\ + VMSPLIT option or use a 64-bit configuration instead. See SCST core\ + README file for details." #endif #ifdef CONFIG_SCST_DEBUG