Skip to content

Commit 68cbd41

Browse files
Frederic WeisbeckerPeter Zijlstra
authored andcommitted
task_work: s/task_work_cancel()/task_work_cancel_func()/
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 57e1199 commit 68cbd41

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
@@ -1337,7 +1337,7 @@ static int irq_thread(void *data)
13371337
* synchronize_hardirq(). So neither IRQTF_RUNTHREAD nor the
13381338
* oneshot mask bit can be set.
13391339
*/
1340-
task_work_cancel(current, irq_thread_dtor);
1340+
task_work_cancel_func(current, irq_thread_dtor);
13411341
return 0;
13421342
}
13431343

kernel/task_work.c

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

122122
/**
123-
* task_work_cancel - cancel a pending work added by task_work_add()
124-
* @task: the task which should execute the work
125-
* @func: identifies the work to remove
123+
* task_work_cancel_func - cancel a pending work matching a function added by task_work_add()
124+
* @task: the task which should execute the func's work
125+
* @func: identifies the func to match with a work to remove
126126
*
127127
* Find the last queued pending work with ->func == @func and remove
128128
* it from queue.
@@ -131,7 +131,7 @@ static bool task_work_func_match(struct callback_head *cb, void *data)
131131
* The found work or NULL if not found.
132132
*/
133133
struct callback_head *
134-
task_work_cancel(struct task_struct *task, task_work_func_t func)
134+
task_work_cancel_func(struct task_struct *task, task_work_func_t func)
135135
{
136136
return task_work_cancel_match(task, task_work_func_match, func);
137137
}
@@ -168,7 +168,7 @@ void task_work_run(void)
168168
if (!work)
169169
break;
170170
/*
171-
* Synchronize with task_work_cancel(). It can not remove
171+
* Synchronize with task_work_cancel_match(). It can not remove
172172
* the first entry == work, cmpxchg(task_works) must fail.
173173
* But it can remove another entry from the ->next list.
174174
*/

security/keys/keyctl.c

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

16961696
/* cancel an already pending keyring replacement */
1697-
oldwork = task_work_cancel(parent, key_change_session_keyring);
1697+
oldwork = task_work_cancel_func(parent, key_change_session_keyring);
16981698

16991699
/* the replacement session keyring is applied just prior to userspace
17001700
* restarting */

0 commit comments

Comments
 (0)