Commit 6e4755ed authored by Anton Blanchard's avatar Anton Blanchard

ppc64: add in hugetlb quota fixes

parent d3ca555b
...@@ -507,14 +507,21 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma) ...@@ -507,14 +507,21 @@ int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
+ (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT)); + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
page = find_get_page(mapping, idx); page = find_get_page(mapping, idx);
if (!page) { if (!page) {
/* charge the fs quota first */
if (hugetlb_get_quota(mapping)) {
ret = -ENOMEM;
goto out;
}
page = alloc_hugetlb_page(); page = alloc_hugetlb_page();
if (!page) { if (!page) {
hugetlb_put_quota(mapping);
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC); ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
unlock_page(page); unlock_page(page);
if (ret) { if (ret) {
hugetlb_put_quota(mapping);
free_huge_page(page); free_huge_page(page);
goto out; goto out;
} }
......
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