aboutsummaryrefslogtreecommitdiff
path: root/ubuntu
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2010-12-09 16:04:33 +0000
committerJohn Rigby <john.rigby@linaro.org>2011-11-16 14:23:42 -0700
commit6def958fa2a2371c79f7191bd9b169bee8804479 (patch)
tree81940c13fc5b02b46ed56c1e200c4838390ff1ba /ubuntu
parentc863312de5067f6a619e14b3edb4c5f708ec6e3b (diff)
UBUNTU: ubuntu: iscsitarget -- re-instate copy_io_context
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'ubuntu')
-rw-r--r--ubuntu/iscsitarget/wthread.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ubuntu/iscsitarget/wthread.c b/ubuntu/iscsitarget/wthread.c
index 997a3d65c59..f77138bc348 100644
--- a/ubuntu/iscsitarget/wthread.c
+++ b/ubuntu/iscsitarget/wthread.c
@@ -59,6 +59,19 @@ static int cmnd_execute(struct iscsi_cmnd *cmnd)
return target_type_array[type]->execute_cmnd(cmnd);
}
+static void copy_io_context(struct io_context **pdst, struct io_context **psrc)
+{
+ struct io_context *src = *psrc;
+ struct io_context *dst = *pdst;
+
+ if (src) {
+ BUG_ON(atomic_long_read(&src->refcount) == 0);
+ atomic_long_inc(&src->refcount);
+ put_io_context(dst);
+ *pdst = src;
+ }
+}
+
static int worker_thread(void *arg)
{
struct worker_thread *wt = (struct worker_thread *) arg;