Create the LinuxKPI current task structure on the fly if it doesn't

exist when the current macro is used.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2017-04-07 14:43:28 +00:00
parent 16e77e0036
commit 22cbd6ef2e

View File

@ -74,7 +74,11 @@ struct task_struct {
struct completion exited;
};
#define current ((struct task_struct *)curthread->td_lkpi_task)
#define current ({ \
struct thread *__td = curthread; \
linux_set_current(__td); \
((struct task_struct *)__td->td_lkpi_task); \
})
#define task_pid_group_leader(task) (task)->task_thread->td_proc->p_pid
#define task_pid(task) ((task)->pid)