summaryrefslogtreecommitdiff
path: root/include/linux/task_work.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-08-04 05:41:33 +0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-04 05:41:33 +0400
commitf9cd49033b349b8be3bb1f01b39eed837853d880 (patch)
tree7f10a70e420f83cce2709e67ff993270276f0277 /include/linux/task_work.h
parent2f2da1e2995c9362babd7da3cc9d340be184ea73 (diff)
parent0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff)
downloadlinux-f9cd49033b349b8be3bb1f01b39eed837853d880.tar.xz
Merge tag 'v3.6-rc1' into staging/for_v3.6
Linux 3.6-rc1 * tag 'v3.6-rc1': (18733 commits) Linux 3.6-rc1 mm: remove node_start_pfn checking in new WARN_ON for now ARM: mmp: add missing irqs.h arm: mvebu: fix typo in .dtsi comment for Armada XP SoCs ARM: PRIMA2: delete redundant codes to restore LATCHED when timer resumes libceph: fix crypto key null deref, memory leak ceph: simplify+fix atomic_open sh: explicitly include sh_dma.h in setup-sh7722.c um: Add arch/x86/um to MAINTAINERS um: pass siginfo to guest process um: fix ubd_file_size for read-only files md/dm-raid: DM_RAID should select MD_RAID10 md/raid1: submit IO from originating thread instead of md thread. raid5: raid5d handle stripe in batch way raid5: make_request use batch stripe release um: pull interrupt_end() into userspace() um: split syscall_trace(), pass pt_regs to it um: switch UPT_SET_RETURN_VALUE and regs_return_value to pt_regs MIPS: Loongson 2: Sort out clock managment. locks: remove unused lm_release_private ...
Diffstat (limited to 'include/linux/task_work.h')
-rw-r--r--include/linux/task_work.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/linux/task_work.h b/include/linux/task_work.h
new file mode 100644
index 000000000000..fb46b03b1852
--- /dev/null
+++ b/include/linux/task_work.h
@@ -0,0 +1,25 @@
+#ifndef _LINUX_TASK_WORK_H
+#define _LINUX_TASK_WORK_H
+
+#include <linux/list.h>
+#include <linux/sched.h>
+
+typedef void (*task_work_func_t)(struct callback_head *);
+
+static inline void
+init_task_work(struct callback_head *twork, task_work_func_t func)
+{
+ twork->func = func;
+}
+
+int task_work_add(struct task_struct *task, struct callback_head *twork, bool);
+struct callback_head *task_work_cancel(struct task_struct *, task_work_func_t);
+void task_work_run(void);
+
+static inline void exit_task_work(struct task_struct *task)
+{
+ if (unlikely(task->task_works))
+ task_work_run();
+}
+
+#endif /* _LINUX_TASK_WORK_H */