diff options
author | Andy Whitcroft <apw@canonical.com> | 2010-12-09 16:04:33 +0000 |
---|---|---|
committer | John Rigby <john.rigby@linaro.org> | 2011-09-23 08:47:49 -0600 |
commit | a35233fc48fc30505715484aec87b1d1042783d1 (patch) | |
tree | d77e40e89acec72db7e8ad676f373442032f86cd /ubuntu | |
parent | f31d42bf0ff5ab758bfdbe17be29e990b6dc6869 (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.c | 13 |
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; |