diff options
| author | Hugh Dickins <hugh@veritas.com> | 2004-08-23 21:25:09 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-23 21:25:09 -0700 |
| commit | 7dbb1d674cffcd849cd76116144aeff45a5f3f39 (patch) | |
| tree | 86e1589b61284ec04a4ed7898840db17ce304cf3 /include/linux | |
| parent | c524e494f651156938ff2d76f22ad17231b77e20 (diff) | |
[PATCH] clarify get_task_mm (mmgrab)
Clarify mmgrab by collapsing it into get_task_mm (in fork.c not inline),
and commenting on the special case it is guarding against: when use_mm in
an AIO daemon temporarily adopts the mm while it's on its way out.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/sched.h | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 06ccc1cc6771..a9877efe6cb7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -788,8 +788,8 @@ static inline void mmdrop(struct mm_struct * mm) /* mmput gets rid of the mappings and all user-space */ extern void mmput(struct mm_struct *); -/* Grab a reference to the mm if its not already going away */ -extern struct mm_struct *mmgrab(struct mm_struct *); +/* Grab a reference to a task's mm, if it is not already going away */ +extern struct mm_struct *get_task_mm(struct task_struct *task); /* Remove the current tasks stale references to the old mm_struct */ extern void mm_release(struct task_struct *, struct mm_struct *); @@ -890,27 +890,7 @@ static inline void task_unlock(struct task_struct *p) { spin_unlock(&p->alloc_lock); } - -/** - * get_task_mm - acquire a reference to the task's mm - * - * Returns %NULL if the task has no mm. User must release - * the mm via mmput() after use. - */ -static inline struct mm_struct * get_task_mm(struct task_struct * task) -{ - struct mm_struct * mm; - - task_lock(task); - mm = task->mm; - if (mm) - mm = mmgrab(mm); - task_unlock(task); - - return mm; -} - - + /* set thread flags in other task's structures * - see asm/thread_info.h for TIF_xxxx flags available */ |
