]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
page-cgroup: fix flags definition
authorVladimir Davydov <vdavydov@parallels.com>
Thu, 26 Jun 2014 00:42:39 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:39 +0000 (10:42 +1000)
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 <vdavydov@parallels.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/page_cgroup.h

index 97b5c39a31c8aca775436b6ff2c090eac52c1acf..9bfb8e68a595325ae4da72108284b7fb9776f1e1 100644 (file)
@@ -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 */