Lines Matching refs:mm
62 struct mm_struct *mm; in linux_task_alloc() local
72 if ((mm = p->p_linux_mm) == NULL) { in linux_task_alloc()
73 mm = kzalloc(sizeof(*mm), GFP_KERNEL); in linux_task_alloc()
74 mm->refs = 1; in linux_task_alloc()
75 lockinit(&mm->mmap_sem, "drmmms", 0, LK_CANRECURSE); in linux_task_alloc()
78 p->p_linux_mm = mm; in linux_task_alloc()
80 linux_mm_drop(mm); in linux_task_alloc()
81 mm = p->p_linux_mm; in linux_task_alloc()
85 task->mm = mm; in linux_task_alloc()
86 atomic_add_long(&mm->refs, 1); in linux_task_alloc()
100 struct mm_struct *mm; in linux_task_drop() local
104 if ((mm = task->mm) != NULL) { in linux_task_drop()
105 atomic_add_long(&mm->refs, -1); /* proc ref always remains */ in linux_task_drop()
106 task->mm = NULL; in linux_task_drop()
114 struct mm_struct *mm; in linux_proc_drop() local
116 if ((mm = p->p_linux_mm) != NULL) { in linux_proc_drop()
118 linux_mm_drop(mm); in linux_proc_drop()
123 linux_mm_drop(struct mm_struct *mm) in linux_mm_drop() argument
127 refs = atomic_fetchadd_long(&mm->refs, -1); in linux_mm_drop()
130 lockuninit(&mm->mmap_sem); in linux_mm_drop()
131 kfree(mm); in linux_mm_drop()