diff options
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 | */ |
188 | static inline unsigned long | 190 | static inline unsigned long |
189 | vma_address(struct page *page, struct vm_area_struct *vma) | 191 | vma_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; |