diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 22c2d6922c0e..d4c3512e7db4 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -779,10 +779,28 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a | |||
779 | } | 779 | } |
780 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ | 780 | #endif /* CONFIG_MMU && !__ARCH_HAS_4LEVEL_HACK */ |
781 | 781 | ||
782 | #define pte_offset_map_lock(mm, pmd, address, ptlp) \ | ||
783 | ({ \ | ||
784 | spinlock_t *__ptl = &(mm)->page_table_lock; \ | ||
785 | pte_t *__pte = pte_offset_map(pmd, address); \ | ||
786 | *(ptlp) = __ptl; \ | ||
787 | spin_lock(__ptl); \ | ||
788 | __pte; \ | ||
789 | }) | ||
790 | |||
791 | #define pte_unmap_unlock(pte, ptl) do { \ | ||
792 | spin_unlock(ptl); \ | ||
793 | pte_unmap(pte); \ | ||
794 | } while (0) | ||
795 | |||
782 | #define pte_alloc_map(mm, pmd, address) \ | 796 | #define pte_alloc_map(mm, pmd, address) \ |
783 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | 797 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ |
784 | NULL: pte_offset_map(pmd, address)) | 798 | NULL: pte_offset_map(pmd, address)) |
785 | 799 | ||
800 | #define pte_alloc_map_lock(mm, pmd, address, ptlp) \ | ||
801 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc(mm, pmd, address))? \ | ||
802 | NULL: pte_offset_map_lock(mm, pmd, address, ptlp)) | ||
803 | |||
786 | #define pte_alloc_kernel(pmd, address) \ | 804 | #define pte_alloc_kernel(pmd, address) \ |
787 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ | 805 | ((unlikely(!pmd_present(*(pmd))) && __pte_alloc_kernel(pmd, address))? \ |
788 | NULL: pte_offset_kernel(pmd, address)) | 806 | NULL: pte_offset_kernel(pmd, address)) |