[PATCH 19 of 25] ensure mapcount is taken on head pages

Andrea Arcangeli
2009-11-14T18:10:26Z

Unlike the page count, the page mapcount cannot be taken on PageTail compound
pages.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
---

diff --git a/include/linux/rmap.h b/include/linux/rmap.h
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -73,6 +73,7 @@ void page_remove_rmap(struct page *);

static inline void page_dup_rmap(struct page *page)
{
+ VM_BUG_ON(PageTail(page));
atomic_inc(&page->_mapcount);