struct mm_struct * get_task_mm (struct task_struct * task);
Returns NULL if the task has no mm. Checks PF_BORROWED_MM (meaning this kernel workthread has transiently adopted a user mm with use_mm, to do its AIO) is not set and if so returns a reference to it, after bumping up the use count. User must release the mm via mmput after use. Typically used by /proc and ptrace.