task_work: s/task_work_cancel()/task_work_cancel_func()/
BugLink: https://bugs.launchpad.net/bugs/2083196 commit 68cbd415dd4b9c5b9df69f0f091879e56bf5907a upstream. A proper task_work_cancel() API that actually cancels a callback and not *any* callback pointing to a given function is going to be needed for perf events event freeing. Do the appropriate rename to prepare for that. Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240621091601.18227-2-frederic@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
3314cd6ee5
commit
f653e123f4
@@ -30,7 +30,7 @@ int task_work_add(struct task_struct *task, struct callback_head *twork,
|
||||
|
||||
struct callback_head *task_work_cancel_match(struct task_struct *task,
|
||||
bool (*match)(struct callback_head *, void *data), void *data);
|
||||
struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
|
||||
struct callback_head *task_work_cancel_func(struct task_struct *, task_work_func_t);
|
||||
void task_work_run(void);
|
||||
|
||||
static inline void exit_task_work(struct task_struct *task)
|
||||
|
||||
+1
-1
@@ -1332,7 +1332,7 @@ static int irq_thread(void *data)
|
||||
* synchronize_hardirq(). So neither IRQTF_RUNTHREAD nor the
|
||||
* oneshot mask bit can be set.
|
||||
*/
|
||||
task_work_cancel(current, irq_thread_dtor);
|
||||
task_work_cancel_func(current, irq_thread_dtor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -121,9 +121,9 @@ static bool task_work_func_match(struct callback_head *cb, void *data)
|
||||
}
|
||||
|
||||
/**
|
||||
* task_work_cancel - cancel a pending work added by task_work_add()
|
||||
* @task: the task which should execute the work
|
||||
* @func: identifies the work to remove
|
||||
* task_work_cancel_func - cancel a pending work matching a function added by task_work_add()
|
||||
* @task: the task which should execute the func's work
|
||||
* @func: identifies the func to match with a work to remove
|
||||
*
|
||||
* Find the last queued pending work with ->func == @func and remove
|
||||
* it from queue.
|
||||
@@ -132,7 +132,7 @@ static bool task_work_func_match(struct callback_head *cb, void *data)
|
||||
* The found work or NULL if not found.
|
||||
*/
|
||||
struct callback_head *
|
||||
task_work_cancel(struct task_struct *task, task_work_func_t func)
|
||||
task_work_cancel_func(struct task_struct *task, task_work_func_t func)
|
||||
{
|
||||
return task_work_cancel_match(task, task_work_func_match, func);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ void task_work_run(void)
|
||||
if (!work)
|
||||
break;
|
||||
/*
|
||||
* Synchronize with task_work_cancel(). It can not remove
|
||||
* Synchronize with task_work_cancel_match(). It can not remove
|
||||
* the first entry == work, cmpxchg(task_works) must fail.
|
||||
* But it can remove another entry from the ->next list.
|
||||
*/
|
||||
|
||||
@@ -1693,7 +1693,7 @@ long keyctl_session_to_parent(void)
|
||||
goto unlock;
|
||||
|
||||
/* cancel an already pending keyring replacement */
|
||||
oldwork = task_work_cancel(parent, key_change_session_keyring);
|
||||
oldwork = task_work_cancel_func(parent, key_change_session_keyring);
|
||||
|
||||
/* the replacement session keyring is applied just prior to userspace
|
||||
* restarting */
|
||||
|
||||
Reference in New Issue
Block a user