aboutsummaryrefslogtreecommitdiffstats
path: root/mm/rmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 8990f909492f..dc3be5f5b0da 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -183,7 +183,9 @@ static void page_unlock_anon_vma(struct anon_vma *anon_vma)
183} 183}
184 184
185/* 185/*
186 * At what user virtual address is page expected in vma? 186 * At what user virtual address is page expected in @vma?
187 * Returns virtual address or -EFAULT if page's index/offset is not
188 * within the range mapped the @vma.
187 */ 189 */
188static inline unsigned long 190static inline unsigned long
189vma_address(struct page *page, struct vm_area_struct *vma) 191vma_address(struct page *page, struct vm_area_struct *vma)
@@ -193,8 +195,7 @@ vma_address(struct page *page, struct vm_area_struct *vma)
193 195
194 address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); 196 address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
195 if (unlikely(address < vma->vm_start || address >= vma->vm_end)) { 197 if (unlikely(address < vma->vm_start || address >= vma->vm_end)) {
196 /* page should be within any vma from prio_tree_next */ 198 /* page should be within @vma mapping range */
197 BUG_ON(!PageAnon(page));
198 return -EFAULT; 199 return -EFAULT;
199 } 200 }
200 return address; 201 return address;