Patch from Mark Buechler <mark.buechler@gmail.com> adding io_context patch for 2...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 18 Sep 2009 10:33:12 +0000 (10:33 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Fri, 18 Sep 2009 10:33:12 +0000 (10:33 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1113 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scst/kernel/io_context-2.6.26.patch [new file with mode: 0644]

diff --git a/scst/kernel/io_context-2.6.26.patch b/scst/kernel/io_context-2.6.26.patch
new file mode 100644 (file)
index 0000000..197c66e
--- /dev/null
@@ -0,0 +1,68 @@
+diff -rup linux-source-2.6.26.orig/block/blk-ioc.c linux-source-2.6.26/block/blk-ioc.c
+--- linux-source-2.6.26.orig/block/blk-ioc.c   2008-07-13 17:51:29.000000000 -0400
++++ linux-source-2.6.26/block/blk-ioc.c        2009-08-26 13:31:49.000000000 -0400
+@@ -65,6 +65,21 @@ static void cfq_exit(struct io_context *
+       rcu_read_unlock();
+ }
++void __exit_io_context(struct io_context *ioc)
++{
++      if (ioc == NULL)
++              return;
++
++      if (atomic_dec_and_test(&ioc->nr_tasks)) {
++              if (ioc->aic && ioc->aic->exit)
++                      ioc->aic->exit(ioc->aic);
++              cfq_exit(ioc);
++
++              put_io_context(ioc);
++      }
++}
++EXPORT_SYMBOL(__exit_io_context);
++
+ /* Called by the exitting task */
+ void exit_io_context(void)
+ {
+@@ -75,13 +90,7 @@ void exit_io_context(void)
+       current->io_context = NULL;
+       task_unlock(current);
+-      if (atomic_dec_and_test(&ioc->nr_tasks)) {
+-              if (ioc->aic && ioc->aic->exit)
+-                      ioc->aic->exit(ioc->aic);
+-              cfq_exit(ioc);
+-
+-              put_io_context(ioc);
+-      }
++      __exit_io_context(ioc);
+ }
+ struct io_context *alloc_io_context(gfp_t gfp_flags, int node)
+@@ -106,6 +115,8 @@ struct io_context *alloc_io_context(gfp_
+       return ret;
+ }
++EXPORT_SYMBOL(alloc_io_context);
++
+ /*
+  * If the current task has no IO context then create one and initialise it.
+  * Otherwise, return its existing IO context.
+diff -rup linux-source-2.6.26.orig/include/linux/iocontext.h linux-source-2.6.26/include/linux/iocontext.h
+--- linux-source-2.6.26.orig/include/linux/iocontext.h 2008-07-13 17:51:29.000000000 -0400
++++ linux-source-2.6.26/include/linux/iocontext.h      2009-08-26 13:34:11.000000000 -0400
+@@ -4,6 +4,8 @@
+ #include <linux/radix-tree.h>
+ #include <linux/rcupdate.h>
++#define SCST_IO_CONTEXT
++
+ /*
+  * This is the per-process anticipatory I/O scheduler state.
+  */
+@@ -99,4 +101,6 @@ static inline struct io_context *ioc_tas
+       return NULL;
+ }
++void __exit_io_context(struct io_context *ioc);
++
+ #endif