diff options
| author | Steve French <sfrench@us.ibm.com> | 2007-11-25 04:53:27 -0500 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2007-11-25 04:53:27 -0500 |
| commit | 058250a0d5886b4d96a195ecc7e3a75e2df5e4b1 (patch) | |
| tree | fb67e8f5258c6aa11d4e8c39650e23de7556b38d /mm/rmap.c | |
| parent | cea218054ad277d6c126890213afde07b4eb1602 (diff) | |
| parent | 2ffbb8377c7a0713baf6644e285adc27a5654582 (diff) | |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
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; |
