lkml.org 
[lkml]   [2018]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 68/79] mm/vma_address: convert page's index lookup to be against specific mapping
Date
From: Jérôme Glisse <jglisse@redhat.com>

Pass down the mapping ...

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: linux-mm@kvack.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
---
mm/internal.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mm/internal.h b/mm/internal.h
index e6bd35182dae..43e9ed27362f 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -336,7 +336,9 @@ extern pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma);
static inline unsigned long
__vma_address(struct page *page, struct vm_area_struct *vma)
{
- pgoff_t pgoff = page_to_pgoff(page);
+ struct address_space *mapping = vma->vm_file ? vma->vm_file->f_mapping : NULL;
+
+ pgoff_t pgoff = _page_to_pgoff(page, mapping);
return vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT);
}

--
2.14.3
\
 
 \ /
  Last update: 2018-04-04 21:20    [W:0.201 / U:2.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site