summaryrefslogtreecommitdiff
path: root/include/linux/sched.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@nuts.ninka.net>2003-08-20 20:47:23 -0700
committerDavid S. Miller <davem@nuts.ninka.net>2003-08-20 20:47:23 -0700
commit658dcd3b0d4340b434353cb8a2b4125bfabb923d (patch)
tree3cfecdde3caab3ae145587a24be28d4ebafb2736 /include/linux/sched.h
parent5f6e4c742685e7c32dcc3ce3e28c87a9a8741029 (diff)
parentbe974925bc048c419f66e49b3744d98208e54831 (diff)
Merge nuts.ninka.net:/home/davem/src/BK/network-2.5
into nuts.ninka.net:/home/davem/src/BK/net-2.5
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r--include/linux/sched.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 61ec12b5b77a..054168543a45 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -638,6 +638,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 *);
/* Remove the current tasks stale references to the old mm_struct */
extern void mm_release(struct task_struct *, struct mm_struct *);
@@ -745,7 +747,7 @@ static inline struct mm_struct * get_task_mm(struct task_struct * task)
task_lock(task);
mm = task->mm;
if (mm)
- atomic_inc(&mm->mm_users);
+ mm = mmgrab(mm);
task_unlock(task);
return mm;