diff --git a/sys/compat/linuxkpi/common/include/linux/mm_types.h b/sys/compat/linuxkpi/common/include/linux/mm_types.h index cb678c6b3c8..6b13dfd9b62 100644 --- a/sys/compat/linuxkpi/common/include/linux/mm_types.h +++ b/sys/compat/linuxkpi/common/include/linux/mm_types.h @@ -38,11 +38,9 @@ struct vm_area_struct; struct task_struct; -struct vmspace; struct mm_struct { struct vm_area_struct *mmap; - struct vmspace *vmspace; atomic_t mm_count; atomic_t mm_users; size_t pinned_vm; diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index ca0fb0c4f32..f64c8c73194 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -96,7 +96,6 @@ linux_alloc_current(struct thread *td, int flags) init_rwsem(&mm->mmap_sem); atomic_set(&mm->mm_count, 1); atomic_set(&mm->mm_users, 1); - mm->vmspace = vmspace_acquire_ref(proc); /* set mm_struct pointer */ ts->mm = mm; /* clear pointer to not free memory */ @@ -119,7 +118,7 @@ linux_get_task_mm(struct task_struct *task) struct mm_struct *mm; mm = task->mm; - if (mm != NULL && mm->vmspace != NULL) { + if (mm != NULL) { atomic_inc(&mm->mm_users); return (mm); } @@ -129,8 +128,6 @@ linux_get_task_mm(struct task_struct *task) void linux_mm_dtor(struct mm_struct *mm) { - if (mm->vmspace != NULL) - vmspace_free(mm->vmspace); free(mm, M_LINUX_CURRENT); } diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index 98c6a6eae98..b2165ace5a5 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -268,7 +268,7 @@ get_user_pages_remote(struct task_struct *task, struct mm_struct *mm, { vm_map_t map; - map = &mm->vmspace->vm_map; + map = &task->task_thread->td_proc->p_vmspace->vm_map; return (linux_get_user_pages_internal(map, start, nr_pages, !!(gup_flags & FOLL_WRITE), pages)); }