Commit 0371880f authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller

[PATCH] hugetlb: fix zap_hugetlb_resources()

Patch from William Lee Irwin III <wli@holomorphy.com>

This patch eliminates zap_hugetlb_resources, along with its usages.
This actually fixes bugs, as zap_hugetlb_resources was itself buggy.
parent 3dd63b7d
...@@ -23,8 +23,6 @@ struct list_head htlbpage_freelist; ...@@ -23,8 +23,6 @@ struct list_head htlbpage_freelist;
spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED; spinlock_t htlbpage_lock = SPIN_LOCK_UNLOCKED;
extern long htlbpagemem; extern long htlbpagemem;
void zap_hugetlb_resources(struct vm_area_struct *);
#define MAX_ID 32 #define MAX_ID 32
struct htlbpagekey { struct htlbpagekey {
struct inode *in; struct inode *in;
...@@ -143,7 +141,7 @@ int make_hugetlb_pages_present(unsigned long addr, unsigned long end, int flags) ...@@ -143,7 +141,7 @@ int make_hugetlb_pages_present(unsigned long addr, unsigned long end, int flags)
out_error: /* Error case, remove the partial lp_resources. */ out_error: /* Error case, remove the partial lp_resources. */
if (addr > vma->vm_start) { if (addr > vma->vm_start) {
vma->vm_end = addr; vma->vm_end = addr;
zap_hugetlb_resources(vma); zap_hugepage_range(vma, vma->vm_start, vma->vm_end - vma->vm_start);
vma->vm_end = end; vma->vm_end = end;
} }
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
...@@ -296,11 +294,6 @@ void zap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigne ...@@ -296,11 +294,6 @@ void zap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigne
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
} }
void zap_hugetlb_resources(struct vm_area_struct *vma)
{
zap_hugepage_range(vma, vma->vm_start, vma->vm_end);
}
static void unlink_vma(struct vm_area_struct *mpnt) static void unlink_vma(struct vm_area_struct *mpnt)
{ {
struct mm_struct *mm = current->mm; struct mm_struct *mm = current->mm;
...@@ -430,7 +423,7 @@ static int alloc_shared_hugetlb_pages(int key, unsigned long addr, unsigned long ...@@ -430,7 +423,7 @@ static int alloc_shared_hugetlb_pages(int key, unsigned long addr, unsigned long
unsigned long raddr; unsigned long raddr;
raddr = vma->vm_end; raddr = vma->vm_end;
vma->vm_end = addr; vma->vm_end = addr;
zap_hugetlb_resources(vma); zap_hugepage_range(vma, vma->vm_start, vma->vm_end - vma->vm_start);
vma->vm_end = raddr; vma->vm_end = raddr;
} }
spin_unlock(&mm->page_table_lock); spin_unlock(&mm->page_table_lock);
......
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