diff options
Diffstat (limited to 'mm/hugetlb.c')
| -rw-r--r-- | mm/hugetlb.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 2d16fa6b8c2d..ffbdfc86aedf 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | * Generic hugetlb support. | 2 | * Generic hugetlb support. |
| 3 | * (C) William Irwin, April 2004 | 3 | * (C) William Irwin, April 2004 |
| 4 | */ | 4 | */ |
| 5 | #include <linux/gfp.h> | ||
| 6 | #include <linux/list.h> | 5 | #include <linux/list.h> |
| 7 | #include <linux/init.h> | 6 | #include <linux/init.h> |
| 8 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| @@ -18,6 +17,7 @@ | |||
| 18 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
| 19 | #include <linux/bootmem.h> | 18 | #include <linux/bootmem.h> |
| 20 | #include <linux/sysfs.h> | 19 | #include <linux/sysfs.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | 21 | ||
| 22 | #include <asm/page.h> | 22 | #include <asm/page.h> |
| 23 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
| @@ -546,6 +546,7 @@ static void free_huge_page(struct page *page) | |||
| 546 | 546 | ||
| 547 | mapping = (struct address_space *) page_private(page); | 547 | mapping = (struct address_space *) page_private(page); |
| 548 | set_page_private(page, 0); | 548 | set_page_private(page, 0); |
| 549 | page->mapping = NULL; | ||
| 549 | BUG_ON(page_count(page)); | 550 | BUG_ON(page_count(page)); |
| 550 | INIT_LIST_HEAD(&page->lru); | 551 | INIT_LIST_HEAD(&page->lru); |
| 551 | 552 | ||
| @@ -2087,7 +2088,7 @@ static void set_huge_ptep_writable(struct vm_area_struct *vma, | |||
| 2087 | 2088 | ||
| 2088 | entry = pte_mkwrite(pte_mkdirty(huge_ptep_get(ptep))); | 2089 | entry = pte_mkwrite(pte_mkdirty(huge_ptep_get(ptep))); |
| 2089 | if (huge_ptep_set_access_flags(vma, address, ptep, entry, 1)) { | 2090 | if (huge_ptep_set_access_flags(vma, address, ptep, entry, 1)) { |
| 2090 | update_mmu_cache(vma, address, entry); | 2091 | update_mmu_cache(vma, address, ptep); |
| 2091 | } | 2092 | } |
| 2092 | } | 2093 | } |
| 2093 | 2094 | ||
| @@ -2447,8 +2448,10 @@ retry: | |||
| 2447 | spin_lock(&inode->i_lock); | 2448 | spin_lock(&inode->i_lock); |
| 2448 | inode->i_blocks += blocks_per_huge_page(h); | 2449 | inode->i_blocks += blocks_per_huge_page(h); |
| 2449 | spin_unlock(&inode->i_lock); | 2450 | spin_unlock(&inode->i_lock); |
| 2450 | } else | 2451 | } else { |
| 2451 | lock_page(page); | 2452 | lock_page(page); |
| 2453 | page->mapping = HUGETLB_POISON; | ||
| 2454 | } | ||
| 2452 | } | 2455 | } |
| 2453 | 2456 | ||
| 2454 | /* | 2457 | /* |
| @@ -2558,7 +2561,7 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | |||
| 2558 | entry = pte_mkyoung(entry); | 2561 | entry = pte_mkyoung(entry); |
| 2559 | if (huge_ptep_set_access_flags(vma, address, ptep, entry, | 2562 | if (huge_ptep_set_access_flags(vma, address, ptep, entry, |
| 2560 | flags & FAULT_FLAG_WRITE)) | 2563 | flags & FAULT_FLAG_WRITE)) |
| 2561 | update_mmu_cache(vma, address, entry); | 2564 | update_mmu_cache(vma, address, ptep); |
| 2562 | 2565 | ||
| 2563 | out_page_table_lock: | 2566 | out_page_table_lock: |
| 2564 | spin_unlock(&mm->page_table_lock); | 2567 | spin_unlock(&mm->page_table_lock); |
