--- 2.5.63-objrmap/include/linux/mm.h 2003-02-27 15:58:34.000000000 -0600 +++ 2.5.63-objfix/include/linux/mm.h 2003-02-28 14:21:56.000000000 -0600 @@ -363,10 +363,16 @@ * Return true if this page is mapped into pagetables. Subtle: test pte.direct * rather than pte.chain. Because sometimes pte.direct is 64-bit, and .chain * is only 32-bit. + * + * If the page is an object-mapped page, we need to do an atomic read of + * pte.mapcount instead, since atomic values may not be zero in the upper bits. */ static inline int page_mapped(struct page *page) { - return page->pte.direct != 0; + if (PageAnon(page)) + return page->pte.direct != 0; + else + return atomic_read(&page->pte.mapcount) != 0; } /*