summaryrefslogtreecommitdiffstats
path: root/sys/cddl/compat
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-05-24 20:07:15 +0000
committerpjd <pjd@FreeBSD.org>2011-05-24 20:07:15 +0000
commit32c533f9820392a61e9edde30ec09e28d8b3bb1d (patch)
treeb3f27f8cb952b390eabc1d3ec318b7307fd8cf21 /sys/cddl/compat
parent3c1a24d7018d4bb8278eaa5c886d2b2551644214 (diff)
downloadFreeBSD-src-32c533f9820392a61e9edde30ec09e28d8b3bb1d.zip
FreeBSD-src-32c533f9820392a61e9edde30ec09e28d8b3bb1d.tar.gz
Don't access task structure once we call task function.
The task structure might be no longer available. This also allows to eliminates the need for two tasks in the zio structure. Submitted by: anonymous MFC after: 2 weeks
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c5
-rw-r--r--sys/cddl/compat/opensolaris/sys/taskq.h1
2 files changed, 0 insertions, 6 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c b/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
index 5a20488..a74f795 100644
--- a/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
+++ b/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c
@@ -147,9 +147,7 @@ taskq_run_safe(void *arg, int pending __unused)
{
struct ostask *task = arg;
- ASSERT(task->ost_magic == TASKQ_MAGIC);
task->ost_func(task->ost_arg);
- task->ost_magic = 0;
}
taskqid_t
@@ -158,15 +156,12 @@ taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg, u_int flags,
{
int prio;
- ASSERT(task->ost_magic != TASKQ_MAGIC);
-
/*
* If TQ_FRONT is given, we want higher priority for this task, so it
* can go at the front of the queue.
*/
prio = !!(flags & TQ_FRONT);
- task->ost_magic = TASKQ_MAGIC;
task->ost_func = func;
task->ost_arg = arg;
diff --git a/sys/cddl/compat/opensolaris/sys/taskq.h b/sys/cddl/compat/opensolaris/sys/taskq.h
index eedc4da..ffe70ca 100644
--- a/sys/cddl/compat/opensolaris/sys/taskq.h
+++ b/sys/cddl/compat/opensolaris/sys/taskq.h
@@ -35,7 +35,6 @@ struct ostask {
struct task ost_task;
task_func_t *ost_func;
void *ost_arg;
- int ost_magic;
};
taskqid_t taskq_dispatch_safe(taskq_t *tq, task_func_t func, void *arg,
OpenPOWER on IntegriCloud