From: Vladimir Davydov Date: Thu, 26 Jun 2014 00:42:39 +0000 (+1000) Subject: page-cgroup: fix flags definition X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ed84eeb37179afb873584ecf14afe7cf0c43893c;p=karo-tx-linux.git page-cgroup: fix flags definition Since commit a9ce315aaec1f ("mm: memcontrol: rewrite uncharge API"), PCG_* flags are used as bit masks, but they are still defined in a enum as bit numbers. Fix it. Signed-off-by: Vladimir Davydov Cc: Michal Hocko Cc: Hugh Dickins Cc: Tejun Heo Cc: Vladimir Davydov Cc: Johannes Weiner Signed-off-by: Andrew Morton --- diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 97b5c39a31c8..9bfb8e68a595 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h @@ -3,9 +3,9 @@ enum { /* flags for mem_cgroup */ - PCG_USED, /* This page is charged to a memcg */ - PCG_MEM, /* This page holds a memory charge */ - PCG_MEMSW, /* This page holds a memory+swap charge */ + PCG_USED = 0x01, /* This page is charged to a memcg */ + PCG_MEM = 0x02, /* This page holds a memory charge */ + PCG_MEMSW = 0x04, /* This page holds a memory+swap charge */ __NR_PCG_FLAGS, }; @@ -46,7 +46,7 @@ struct page *lookup_cgroup_page(struct page_cgroup *pc); static inline int PageCgroupUsed(struct page_cgroup *pc) { - return test_bit(PCG_USED, &pc->flags); + return !!(pc->flags & PCG_USED); } #else /* CONFIG_MEMCG */