From: Timo Kokkonen Date: Sun, 10 Jun 2012 18:37:16 +0000 (+0300) Subject: pagemap.h: Do not use hardcoded maximum number of kpageflags X-Git-Url: http://git.itanic.dy.fi/?p=scan-pagemap;a=commitdiff_plain;h=a4261cff2ba98de4bb6bfd251092169a7fb4cf28 pagemap.h: Do not use hardcoded maximum number of kpageflags 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 --- diff --git a/pagemap.h b/pagemap.h index a8ce444..6d5bbc7 100644 --- 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;