Commit 7b76295a authored by Hugh Dickins's avatar Hugh Dickins Committed by Russell King

[PATCH] make_coherent pgoff

Patch from Hugh Dickins

In wandering through the Linus 2.6 tree preparing for changeover of
i_mmap and i_mmap_shared to Rajesh's prio tree for object-based rmap...
I noticed that pgoff in make_coherent doesn't add up (plus, I think
we need to mask out the word "don't" in the comment further down).
2.4.25 looks equally wrong.
parent 8b042176
......@@ -226,9 +226,11 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
{
struct list_head *l;
struct mm_struct *mm = vma->vm_mm;
unsigned long pgoff = (addr - vma->vm_start) >> PAGE_SHIFT;
unsigned long pgoff;
int aliases = 0;
pgoff = vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT);
/*
* If we have any shared mappings that are in the same mm
* space, then we need to handle them specially to maintain
......@@ -242,7 +244,7 @@ make_coherent(struct vm_area_struct *vma, unsigned long addr, struct page *page,
/*
* If this VMA is not in our MM, we can ignore it.
* Note that we intentionally don't mask out the VMA
* Note that we intentionally mask out the VMA
* that we are fixing up.
*/
if (mpnt->vm_mm != mm || mpnt == vma)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment