aboutsummaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 82378d44a0c5..4cf7a90e9140 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1439,19 +1439,9 @@ void __unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
1439void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, 1439void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
1440 unsigned long end, struct page *ref_page) 1440 unsigned long end, struct page *ref_page)
1441{ 1441{
1442 /* 1442 spin_lock(&vma->vm_file->f_mapping->i_mmap_lock);
1443 * It is undesirable to test vma->vm_file as it should be non-null 1443 __unmap_hugepage_range(vma, start, end, ref_page);
1444 * for valid hugetlb area. However, vm_file will be NULL in the error 1444 spin_unlock(&vma->vm_file->f_mapping->i_mmap_lock);
1445 * cleanup path of do_mmap_pgoff. When hugetlbfs ->mmap method fails,
1446 * do_mmap_pgoff() nullifies vma->vm_file before calling this function
1447 * to clean up. Since no pte has actually been setup, it is safe to
1448 * do nothing in this case.
1449 */
1450 if (vma->vm_file) {
1451 spin_lock(&vma->vm_file->f_mapping->i_mmap_lock);
1452 __unmap_hugepage_range(vma, start, end, ref_page);
1453 spin_unlock(&vma->vm_file->f_mapping->i_mmap_lock);
1454 }
1455} 1445}
1456 1446
1457/* 1447/*