mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
mm/hugetlb: simplify the code when alloc_huge_page() failed in hugetlb_no_page()
Rework the error handling code when alloc_huge_page() failed to remove some duplicated code and simplify the code slightly. Link: https://lkml.kernel.org/r/20210308112809.26107-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
5c8ecb131a
commit
d83e6c8a9b
1 changed files with 3 additions and 6 deletions
|
@ -4395,13 +4395,10 @@ retry:
|
||||||
* sure there really is no pte entry.
|
* sure there really is no pte entry.
|
||||||
*/
|
*/
|
||||||
ptl = huge_pte_lock(h, mm, ptep);
|
ptl = huge_pte_lock(h, mm, ptep);
|
||||||
if (!huge_pte_none(huge_ptep_get(ptep))) {
|
ret = 0;
|
||||||
ret = 0;
|
if (huge_pte_none(huge_ptep_get(ptep)))
|
||||||
spin_unlock(ptl);
|
ret = vmf_error(PTR_ERR(page));
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
spin_unlock(ptl);
|
spin_unlock(ptl);
|
||||||
ret = vmf_error(PTR_ERR(page));
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
clear_huge_page(page, address, pages_per_huge_page(h));
|
clear_huge_page(page, address, pages_per_huge_page(h));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue