Skip to content

Commit 28abeba

Browse files
committed
task_work: s/task_work_cancel()/task_work_cancel_func()/
JIRA: https://issues.redhat.com/browse/RHEL-55603 upstream ======== commit 68cbd41 Author: Frederic Weisbecker <frederic@kernel.org> Date: Fri Jun 21 11:15:58 2024 +0200 description =========== 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: Michael Petlan <mpetlan@redhat.com>
1 parent e4bce97 commit 28abeba

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

include/linux/task_work.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ int task_work_add(struct task_struct *task, struct callback_head *twork,
3030

3131
struct callback_head *task_work_cancel_match(struct task_struct *task,
3232
bool (*match)(struct callback_head *, void *data), void *data);
33-
struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
33+
struct callback_head *task_work_cancel_func(struct task_struct *, task_work_func_t);
3434
void task_work_run(void);
3535

3636
static inline void exit_task_work(struct task_struct *task)

kernel/irq/manage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ static int irq_thread(void *data)
12971297
* synchronize_hardirq(). So neither IRQTF_RUNTHREAD nor the
12981298
* oneshot mask bit can be set.
12991299
*/
1300-
task_work_cancel(current, irq_thread_dtor);
1300+
task_work_cancel_func(current, irq_thread_dtor);
13011301
return 0;
13021302
}
13031303

kernel/task_work.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ static bool task_work_func_match(struct callback_head *cb, void *data)
117117
}
118118

119119
/**
120-
* task_work_cancel - cancel a pending work added by task_work_add()
121-
* @task: the task which should execute the work
122-
* @func: identifies the work to remove
120+
* task_work_cancel_func - cancel a pending work matching a function added by task_work_add()
121+
* @task: the task which should execute the func's work
122+
* @func: identifies the func to match with a work to remove
123123
*
124124
* Find the last queued pending work with ->func == @func and remove
125125
* it from queue.
@@ -128,7 +128,7 @@ static bool task_work_func_match(struct callback_head *cb, void *data)
128128
* The found work or NULL if not found.
129129
*/
130130
struct callback_head *
131-
task_work_cancel(struct task_struct *task, task_work_func_t func)
131+
task_work_cancel_func(struct task_struct *task, task_work_func_t func)
132132
{
133133
return task_work_cancel_match(task, task_work_func_match, func);
134134
}
@@ -165,7 +165,7 @@ void task_work_run(void)
165165
if (!work)
166166
break;
167167
/*
168-
* Synchronize with task_work_cancel(). It can not remove
168+
* Synchronize with task_work_cancel_match(). It can not remove
169169
* the first entry == work, cmpxchg(task_works) must fail.
170170
* But it can remove another entry from the ->next list.
171171
*/

security/keys/keyctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ long keyctl_session_to_parent(void)
16891689
goto unlock;
16901690

16911691
/* cancel an already pending keyring replacement */
1692-
oldwork = task_work_cancel(parent, key_change_session_keyring);
1692+
oldwork = task_work_cancel_func(parent, key_change_session_keyring);
16931693

16941694
/* the replacement session keyring is applied just prior to userspace
16951695
* restarting */

0 commit comments

Comments
 (0)