Lines Matching refs:mm
91 down_write(&ctx->mm->mmap_sem); in aio_free_ring()
92 do_munmap(ctx->mm, info->mmap_base, info->mmap_size); in aio_free_ring()
93 up_write(&ctx->mm->mmap_sem); in aio_free_ring()
132 down_write(&ctx->mm->mmap_sem); in aio_setup_ring()
137 up_write(&ctx->mm->mmap_sem); in aio_setup_ring()
144 info->nr_pages = get_user_pages(current, ctx->mm, in aio_setup_ring()
147 up_write(&ctx->mm->mmap_sem); in aio_setup_ring()
220 mmdrop(ctx->mm); in __put_ioctx()
221 ctx->mm = NULL; in __put_ioctx()
241 struct mm_struct *mm; in ioctx_alloc() local
260 mm = ctx->mm = current->mm; in ioctx_alloc()
261 atomic_inc(&mm->mm_count); in ioctx_alloc()
297 spin_lock(&mm->ioctx_lock); in ioctx_alloc()
298 hlist_add_head_rcu(&ctx->list, &mm->ioctx_list); in ioctx_alloc()
299 spin_unlock(&mm->ioctx_lock); in ioctx_alloc()
302 ctx, ctx->user_id, current->mm, ctx->ring_info.nr); in ioctx_alloc()
310 mmdrop(mm); in ioctx_alloc()
391 void exit_aio(struct mm_struct *mm) in exit_aio() argument
395 while (!hlist_empty(&mm->ioctx_list)) { in exit_aio()
396 ctx = hlist_entry(mm->ioctx_list.first, struct kioctx, list); in exit_aio()
589 struct mm_struct *mm = current->mm; in lookup_ioctx() local
595 hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) { in lookup_ioctx()
617 static void use_mm(struct mm_struct *mm) in use_mm() argument
624 atomic_inc(&mm->mm_count); in use_mm()
625 tsk->mm = mm; in use_mm()
626 tsk->active_mm = mm; in use_mm()
627 switch_mm(active_mm, mm, tsk); in use_mm()
641 static void unuse_mm(struct mm_struct *mm) in unuse_mm() argument
646 tsk->mm = NULL; in unuse_mm()
648 enter_lazy_tlb(mm, tsk); in unuse_mm()
877 struct mm_struct *mm; in aio_kick_handler() local
881 use_mm(ctx->mm); in aio_kick_handler()
884 mm = ctx->mm; in aio_kick_handler()
886 unuse_mm(mm); in aio_kick_handler()
1251 struct mm_struct *mm = current->mm; in io_destroy() local
1255 spin_lock(&mm->ioctx_lock); in io_destroy()
1259 spin_unlock(&mm->ioctx_lock); in io_destroy()