mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-27 11:29:36 +03:00
Revert "Make taskq_member() use ->journal_info"
This reverts commit a430c11f0b
. Using
journal_info like this can cause a BUG at kernel fs/jbd2/transaction.c:425!
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #500
This commit is contained in:
parent
a430c11f0b
commit
c5a8b1e163
@ -124,7 +124,7 @@ extern void taskq_wait_id(taskq_t *, taskqid_t);
|
|||||||
extern void taskq_wait_outstanding(taskq_t *, taskqid_t);
|
extern void taskq_wait_outstanding(taskq_t *, taskqid_t);
|
||||||
extern void taskq_wait(taskq_t *);
|
extern void taskq_wait(taskq_t *);
|
||||||
extern int taskq_cancel_id(taskq_t *, taskqid_t);
|
extern int taskq_cancel_id(taskq_t *, taskqid_t);
|
||||||
#define taskq_member(taskq, thread) ((taskq) == ((thread)->journal_info))
|
extern int taskq_member(taskq_t *, void *);
|
||||||
|
|
||||||
#define taskq_create_proc(name, nthreads, pri, min, max, proc, flags) \
|
#define taskq_create_proc(name, nthreads, pri, min, max, proc, flags) \
|
||||||
taskq_create(name, nthreads, pri, min, max, flags)
|
taskq_create(name, nthreads, pri, min, max, flags)
|
||||||
|
@ -448,6 +448,40 @@ taskq_wait(taskq_t *tq)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(taskq_wait);
|
EXPORT_SYMBOL(taskq_wait);
|
||||||
|
|
||||||
|
static int
|
||||||
|
taskq_member_impl(taskq_t *tq, void *t)
|
||||||
|
{
|
||||||
|
struct list_head *l;
|
||||||
|
taskq_thread_t *tqt;
|
||||||
|
int found = 0;
|
||||||
|
|
||||||
|
ASSERT(tq);
|
||||||
|
ASSERT(t);
|
||||||
|
ASSERT(spin_is_locked(&tq->tq_lock));
|
||||||
|
|
||||||
|
list_for_each(l, &tq->tq_thread_list) {
|
||||||
|
tqt = list_entry(l, taskq_thread_t, tqt_thread_list);
|
||||||
|
if (tqt->tqt_thread == (struct task_struct *)t) {
|
||||||
|
found = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (found);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
taskq_member(taskq_t *tq, void *t)
|
||||||
|
{
|
||||||
|
int found;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags);
|
||||||
|
found = taskq_member_impl(tq, t);
|
||||||
|
spin_unlock_irqrestore(&tq->tq_lock, tq->tq_lock_flags);
|
||||||
|
|
||||||
|
return (found);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(taskq_member);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Cancel an already dispatched task given the task id. Still pending tasks
|
* Cancel an already dispatched task given the task id. Still pending tasks
|
||||||
* will be immediately canceled, and if the task is active the function will
|
* will be immediately canceled, and if the task is active the function will
|
||||||
@ -778,7 +812,6 @@ taskq_thread(void *args)
|
|||||||
ASSERT(tqt);
|
ASSERT(tqt);
|
||||||
tq = tqt->tqt_tq;
|
tq = tqt->tqt_tq;
|
||||||
current->flags |= PF_NOFREEZE;
|
current->flags |= PF_NOFREEZE;
|
||||||
current->journal_info = tq;
|
|
||||||
|
|
||||||
#if defined(PF_MEMALLOC_NOIO)
|
#if defined(PF_MEMALLOC_NOIO)
|
||||||
(void) memalloc_noio_save();
|
(void) memalloc_noio_save();
|
||||||
@ -844,8 +877,6 @@ taskq_thread(void *args)
|
|||||||
/* Perform the requested task */
|
/* Perform the requested task */
|
||||||
t->tqent_func(t->tqent_arg);
|
t->tqent_func(t->tqent_arg);
|
||||||
|
|
||||||
ASSERT3P(tq, ==, current->journal_info);
|
|
||||||
|
|
||||||
spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags);
|
spin_lock_irqsave(&tq->tq_lock, tq->tq_lock_flags);
|
||||||
tq->tq_nactive--;
|
tq->tq_nactive--;
|
||||||
list_del_init(&tqt->tqt_active_list);
|
list_del_init(&tqt->tqt_active_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user