pagemap: return map count, not reference count, in /proc/kpagecount
authorThomas Tuttle <[email protected]>
Fri, 6 Jun 2008 05:46:58 +0000 (22:46 -0700)
committerLinus Torvalds <[email protected]>
Fri, 6 Jun 2008 18:29:13 +0000 (11:29 -0700)
Since pagemap is all about examining pages mapped into processes' memory
spaces, it makes sense for kpagecount to return the map counts, not the
reference counts.

Signed-off-by: Thomas Tuttle <[email protected]>
Cc: Matt Mackall <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/proc_misc.c

index 32dc14cd890058dcdd1424a3c1d8ff5c3134c28e..5a16090a6d6e270086bf136f84aaf14b0f8ddb26 100644 (file)
@@ -726,7 +726,7 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,
                if (!ppage)
                        pcount = 0;
                else
-                       pcount = atomic_read(&ppage->_count);
+                       pcount = page_mapcount(ppage);
 
                if (put_user(pcount, out++)) {
                        ret = -EFAULT;