OSDN Git Service

thp: implement split_huge_pmd()
[uclinux-h8/linux.git] / include / linux / huge_mm.h
index 333b058..f1fa1c2 100644 (file)
@@ -92,7 +92,16 @@ extern unsigned long transparent_hugepage_flags;
 
 #define split_huge_page_to_list(page, list) BUILD_BUG()
 #define split_huge_page(page) BUILD_BUG()
-#define split_huge_pmd(__vma, __pmd, __address) BUILD_BUG()
+
+void __split_huge_pmd(struct vm_area_struct *vma, pmd_t *pmd,
+               unsigned long address);
+
+#define split_huge_pmd(__vma, __pmd, __address)                                \
+       do {                                                            \
+               pmd_t *____pmd = (__pmd);                               \
+               if (pmd_trans_huge(*____pmd))                           \
+                       __split_huge_pmd(__vma, __pmd, __address);      \
+       }  while (0)
 
 #if HPAGE_PMD_ORDER >= MAX_ORDER
 #error "hugepages can't be allocated by the buddy allocator"