]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
pagemap.h: Do not use hardcoded maximum number of kpageflags
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 10 Jun 2012 18:37:16 +0000 (21:37 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 10 Jun 2012 18:37:16 +0000 (21:37 +0300)
The kpageflag definitions are subject to change. It is better to have
a dynamic maximum defined for this.

Furthermore, the previous maximum was actually wrong. The KSM pages
were never shown even if such pages were present on the system.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
pagemap.h

index a8ce4443491fe2a77e54d401b842b746b6f1a425..6d5bbc7ce4c8a9ce17c066a64edfdf9cd639d1d5 100644 (file)
--- a/pagemap.h
+++ b/pagemap.h
@@ -92,8 +92,6 @@ static inline int swap_offset(struct pageframe *p)
        return (BITRANGE(5, 54) & p->pf) >> 5;
 }
 
-#define KPAGEFLAGS_NUM 22
-
 enum kpageflags {
        LOCKED,
        ERROR,
@@ -117,8 +115,11 @@ enum kpageflags {
        HWPOISON,
        NOPAGE,
        KSM,
+       __PAGEFLAGS_LAST,
 };
 
+#define KPAGEFLAGS_NUM __PAGEFLAGS_LAST
+
 struct kpageflag_str {
        int flag;
        char *str;