mm: make compound_head() robust
[firefly-linux-kernel-4.4.55.git] / mm / internal.h
index 5b7841f6fa2797cd8b11835baaded9bc4210b989..a7f5670fea23803b4381b0556b6b256d93f69a11 100644 (file)
@@ -80,9 +80,9 @@ static inline void __get_page_tail_foll(struct page *page,
         * speculative page access (like in
         * page_cache_get_speculative()) on tail pages.
         */
-       VM_BUG_ON_PAGE(atomic_read(&page->first_page->_count) <= 0, page);
+       VM_BUG_ON_PAGE(atomic_read(&compound_head(page)->_count) <= 0, page);
        if (get_page_head)
-               atomic_inc(&page->first_page->_count);
+               atomic_inc(&compound_head(page)->_count);
        get_huge_page_tail(page);
 }