vma.h (4f87153e82c4906e917d273ab7accd0d540aab35) vma.h (63fc66f5b6b18f39269a66cf34d8cb7a24fbfe88)
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * vma.h
4 *
5 * Core VMA manipulation API implemented in vma.c.
6 */
7#ifndef __MM_VMA_H
8#define __MM_VMA_H

--- 17 unchanged lines hidden (view full) ---

26 struct vm_area_struct *vmas[8];
27};
28
29/*
30 * vma munmap operation
31 */
32struct vma_munmap_struct {
33 struct vma_iterator *vmi;
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * vma.h
4 *
5 * Core VMA manipulation API implemented in vma.c.
6 */
7#ifndef __MM_VMA_H
8#define __MM_VMA_H

--- 17 unchanged lines hidden (view full) ---

26 struct vm_area_struct *vmas[8];
27};
28
29/*
30 * vma munmap operation
31 */
32struct vma_munmap_struct {
33 struct vma_iterator *vmi;
34 struct mm_struct *mm;
35 struct vm_area_struct *vma; /* The first vma to munmap */
36 struct vm_area_struct *prev; /* vma before the munmap area */
37 struct vm_area_struct *next; /* vma after the munmap area */
38 struct list_head *uf; /* Userfaultfd list_head */
39 unsigned long start; /* Aligned start addr (inclusive) */
40 unsigned long end; /* Aligned end addr (exclusive) */
41 unsigned long unmap_start; /* Unmap PTE start */
42 unsigned long unmap_end; /* Unmap PTE end */

--- 66 unchanged lines hidden (view full) ---

109 * @uf: The userfaultfd list_head
110 * @unlock: Unlock after the operation. Only unlocked on success
111 */
112static inline void init_vma_munmap(struct vma_munmap_struct *vms,
113 struct vma_iterator *vmi, struct vm_area_struct *vma,
114 unsigned long start, unsigned long end, struct list_head *uf,
115 bool unlock)
116{
34 struct vm_area_struct *vma; /* The first vma to munmap */
35 struct vm_area_struct *prev; /* vma before the munmap area */
36 struct vm_area_struct *next; /* vma after the munmap area */
37 struct list_head *uf; /* Userfaultfd list_head */
38 unsigned long start; /* Aligned start addr (inclusive) */
39 unsigned long end; /* Aligned end addr (exclusive) */
40 unsigned long unmap_start; /* Unmap PTE start */
41 unsigned long unmap_end; /* Unmap PTE end */

--- 66 unchanged lines hidden (view full) ---

108 * @uf: The userfaultfd list_head
109 * @unlock: Unlock after the operation. Only unlocked on success
110 */
111static inline void init_vma_munmap(struct vma_munmap_struct *vms,
112 struct vma_iterator *vmi, struct vm_area_struct *vma,
113 unsigned long start, unsigned long end, struct list_head *uf,
114 bool unlock)
115{
117 vms->mm = current->mm;
118 vms->vmi = vmi;
119 vms->vma = vma;
120 if (vma) {
121 vms->start = start;
122 vms->end = end;
123 } else {
124 vms->start = vms->end = 0;
125 }

--- 11 unchanged lines hidden (view full) ---

137
138int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
139 struct ma_state *mas_detach);
140
141void vms_complete_munmap_vmas(struct vma_munmap_struct *vms,
142 struct ma_state *mas_detach);
143
144void vms_clean_up_area(struct vma_munmap_struct *vms,
116 vms->vmi = vmi;
117 vms->vma = vma;
118 if (vma) {
119 vms->start = start;
120 vms->end = end;
121 } else {
122 vms->start = vms->end = 0;
123 }

--- 11 unchanged lines hidden (view full) ---

135
136int vms_gather_munmap_vmas(struct vma_munmap_struct *vms,
137 struct ma_state *mas_detach);
138
139void vms_complete_munmap_vmas(struct vma_munmap_struct *vms,
140 struct ma_state *mas_detach);
141
142void vms_clean_up_area(struct vma_munmap_struct *vms,
145 struct ma_state *mas_detach, bool mm_wr_locked);
143 struct ma_state *mas_detach);
146
147/*
148 * reattach_vmas() - Undo any munmap work and free resources
149 * @mas_detach: The maple state with the detached maple tree
150 *
151 * Reattach any detached vmas and free up the maple tree used to track the vmas.
152 */
153static inline void reattach_vmas(struct ma_state *mas_detach)

--- 372 unchanged lines hidden ---
144
145/*
146 * reattach_vmas() - Undo any munmap work and free resources
147 * @mas_detach: The maple state with the detached maple tree
148 *
149 * Reattach any detached vmas and free up the maple tree used to track the vmas.
150 */
151static inline void reattach_vmas(struct ma_state *mas_detach)

--- 372 unchanged lines hidden ---