mm: introduce page reference manipulation functions
[deliverable/linux.git] / mm / huge_memory.c
index e08b1659ff19c6131d3a9d82c9bab16d06bac551..bb944c771c82c7042dd72911f5ee3c82a2e950b6 100644 (file)
@@ -2888,7 +2888,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd,
 
        page = pmd_page(*pmd);
        VM_BUG_ON_PAGE(!page_count(page), page);
-       atomic_add(HPAGE_PMD_NR - 1, &page->_count);
+       page_ref_add(page, HPAGE_PMD_NR - 1);
        write = pmd_write(*pmd);
        young = pmd_young(*pmd);
        dirty = pmd_dirty(*pmd);
@@ -3257,7 +3257,7 @@ static void __split_huge_page_tail(struct page *head, int tail,
        struct page *page_tail = head + tail;
 
        VM_BUG_ON_PAGE(atomic_read(&page_tail->_mapcount) != -1, page_tail);
-       VM_BUG_ON_PAGE(atomic_read(&page_tail->_count) != 0, page_tail);
+       VM_BUG_ON_PAGE(page_ref_count(page_tail) != 0, page_tail);
 
        /*
         * tail_page->_count is zero and not changing from under us. But
@@ -3270,7 +3270,7 @@ static void __split_huge_page_tail(struct page *head, int tail,
         * atomic_set() here would be safe on all archs (and not only on x86),
         * it's safer to use atomic_inc().
         */
-       atomic_inc(&page_tail->_count);
+       page_ref_inc(page_tail);
 
        page_tail->flags &= ~PAGE_FLAGS_CHECK_AT_PREP;
        page_tail->flags |= (head->flags &
This page took 0.026597 seconds and 5 git commands to generate.