aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-27 01:24:13 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-22 15:57:55 -0400
commit158e1645e07f3e9f7e4962d7a0997f5c3b98311b (patch)
tree09d695b3a0410afe15f7fd6006bc6c1effee151d /include/linux
parent41f9d29f09ca0b22c3631e8a39676e74cda9bcc0 (diff)
trim task_work: get rid of hlist
layout based on Oleg's suggestion; single-linked list, task->task_works points to the last element, forward pointer from said last element points to head. I'd still prefer much more regular scheme with two pointers in task_work, but... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/task_work.h4
-rw-r--r--include/linux/tracehook.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4059c0f33f07..b9216ebc2789 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1405,7 +1405,7 @@ struct task_struct {
1405 int (*notifier)(void *priv); 1405 int (*notifier)(void *priv);
1406 void *notifier_data; 1406 void *notifier_data;
1407 sigset_t *notifier_mask; 1407 sigset_t *notifier_mask;
1408 struct hlist_head task_works; 1408 void *task_works;
1409 1409
1410 struct audit_context *audit_context; 1410 struct audit_context *audit_context;
1411#ifdef CONFIG_AUDITSYSCALL 1411#ifdef CONFIG_AUDITSYSCALL
diff --git a/include/linux/task_work.h b/include/linux/task_work.h
index 627421c0e108..3b3e2c8d037b 100644
--- a/include/linux/task_work.h
+++ b/include/linux/task_work.h
@@ -8,7 +8,7 @@ struct task_work;
8typedef void (*task_work_func_t)(struct task_work *); 8typedef void (*task_work_func_t)(struct task_work *);
9 9
10struct task_work { 10struct task_work {
11 struct hlist_node hlist; 11 struct task_work *next;
12 task_work_func_t func; 12 task_work_func_t func;
13}; 13};
14 14
@@ -24,7 +24,7 @@ void task_work_run(void);
24 24
25static inline void exit_task_work(struct task_struct *task) 25static inline void exit_task_work(struct task_struct *task)
26{ 26{
27 if (unlikely(!hlist_empty(&task->task_works))) 27 if (unlikely(task->task_works))
28 task_work_run(); 28 task_work_run();
29} 29}
30 30
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index 6a4d82bedb03..1e98b5530425 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -192,7 +192,7 @@ static inline void tracehook_notify_resume(struct pt_regs *regs)
192 * hlist_add_head(task->task_works); 192 * hlist_add_head(task->task_works);
193 */ 193 */
194 smp_mb__after_clear_bit(); 194 smp_mb__after_clear_bit();
195 if (unlikely(!hlist_empty(&current->task_works))) 195 if (unlikely(current->task_works))
196 task_work_run(); 196 task_work_run();
197} 197}
198 198