]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/proc/page.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / fs / proc / page.c
index 3b8b456603318f1ff017056cdeda40129d559ab4..6d8e6a9e93aba59e471d32d4ee9dc59b2579d8c4 100644 (file)
@@ -40,7 +40,7 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,
                        ppage = pfn_to_page(pfn);
                else
                        ppage = NULL;
-               if (!ppage)
+               if (!ppage || PageSlab(ppage))
                        pcount = 0;
                else
                        pcount = page_mapcount(ppage);
@@ -116,15 +116,17 @@ u64 stable_page_flags(struct page *page)
        if (PageHuge(page))
                u |= 1 << KPF_HUGE;
 
-       u |= kpf_copy_bit(k, KPF_LOCKED,        PG_locked);
-
        /*
-        * Caveats on high order pages:
-        * PG_buddy will only be set on the head page; SLUB/SLQB do the same
-        * for PG_slab; SLOB won't set PG_slab at all on compound pages.
+        * Caveats on high order pages: page->_count will only be set
+        * -1 on the head page; SLUB/SLQB do the same for PG_slab;
+        * SLOB won't set PG_slab at all on compound pages.
         */
+       if (PageBuddy(page))
+               u |= 1 << KPF_BUDDY;
+
+       u |= kpf_copy_bit(k, KPF_LOCKED,        PG_locked);
+
        u |= kpf_copy_bit(k, KPF_SLAB,          PG_slab);
-       u |= kpf_copy_bit(k, KPF_BUDDY,         PG_buddy);
 
        u |= kpf_copy_bit(k, KPF_ERROR,         PG_error);
        u |= kpf_copy_bit(k, KPF_DIRTY,         PG_dirty);