lkml.org 
[lkml]   [2008]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] huge page MAP_NORESERVE review cleanups
Date

Use the new encapsulated huge page offset helper.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
mm/hugetlb.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 1dce03a..901e580 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -733,8 +733,7 @@ static int vma_needs_reservation(struct vm_area_struct *vma, unsigned long addr)
struct inode *inode = mapping->host;

if (vma->vm_flags & VM_SHARED) {
- unsigned long idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) +
- (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
+ pgoff_t idx = vma_pagecache_offset(vma, addr);
return region_chg(&inode->i_mapping->private_list,
idx, idx + 1);

@@ -752,8 +751,7 @@ static void vma_commit_reservation(struct vm_area_struct *vma,
struct inode *inode = mapping->host;

if (vma->vm_flags & VM_SHARED) {
- unsigned long idx = ((addr - vma->vm_start) >> HPAGE_SHIFT) +
- (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
+ pgoff_t idx = vma_pagecache_offset(vma, addr);
region_add(&inode->i_mapping->private_list, idx, idx + 1);
}
}

\
 
 \ /
  Last update: 2008-05-30 19:01    [W:0.983 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site