I'd rather do it like so, except I'm still conflicted on the naming.
+void wake_q_add(struct wake_q_head *head, struct task_struct *task)
+{
+ if (__wake_q_add(head, task))
+ get_task_struct(task);
+}
+
+void wake_q_add_safe(struct wake_q_head *head, struct task_struct *task)
+{
+ if (!__wake_a_add(head, task))
+ put_task_struct(task);
}
That is, in the one case it has internal reference counting, in the
other case it consumes the reference counting.