Commit bcc66543 authored by Miaohe Lin's avatar Miaohe Lin Committed by Andrew Morton
Browse files

hugetlb: use helper {huge_pte|pmd}_lock()

Use helper huge_pte_lock and pmd_lock to simplify the code. No functional
change intended.

Link: https://lkml.kernel.org/r/20220901120030.63318-6-linmiaohe@huawei.com


Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Reviewed-by: default avatarMuchun Song <songmuchun@bytedance.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 10395680
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -6049,8 +6049,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm,
		page_in_pagecache = true;
	}

	ptl = huge_pte_lockptr(h, dst_mm, dst_pte);
	spin_lock(ptl);
	ptl = huge_pte_lock(h, dst_mm, dst_pte);

	/*
	 * Recheck the i_size after holding PT lock to make sure not