diff options
-rw-r--r-- | include/linux/page_cgroup.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index b02195dfc1b0..fdb5a92b5ac7 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -40,6 +40,9 @@ enum { | |||
40 | PCG_USED, /* this object is in use. */ | 40 | PCG_USED, /* this object is in use. */ |
41 | PCG_ACCT_LRU, /* page has been accounted for */ | 41 | PCG_ACCT_LRU, /* page has been accounted for */ |
42 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ | 42 | PCG_FILE_MAPPED, /* page is accounted as "mapped" */ |
43 | PCG_FILE_DIRTY, /* page is dirty */ | ||
44 | PCG_FILE_WRITEBACK, /* page is under writeback */ | ||
45 | PCG_FILE_UNSTABLE_NFS, /* page is NFS unstable */ | ||
43 | PCG_MIGRATION, /* under page migration */ | 46 | PCG_MIGRATION, /* under page migration */ |
44 | }; | 47 | }; |
45 | 48 | ||
@@ -59,6 +62,10 @@ static inline void ClearPageCgroup##uname(struct page_cgroup *pc) \ | |||
59 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ | 62 | static inline int TestClearPageCgroup##uname(struct page_cgroup *pc) \ |
60 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } | 63 | { return test_and_clear_bit(PCG_##lname, &pc->flags); } |
61 | 64 | ||
65 | #define TESTSETPCGFLAG(uname, lname) \ | ||
66 | static inline int TestSetPageCgroup##uname(struct page_cgroup *pc) \ | ||
67 | { return test_and_set_bit(PCG_##lname, &pc->flags); } | ||
68 | |||
62 | /* Cache flag is set only once (at allocation) */ | 69 | /* Cache flag is set only once (at allocation) */ |
63 | TESTPCGFLAG(Cache, CACHE) | 70 | TESTPCGFLAG(Cache, CACHE) |
64 | CLEARPCGFLAG(Cache, CACHE) | 71 | CLEARPCGFLAG(Cache, CACHE) |
@@ -78,6 +85,22 @@ SETPCGFLAG(FileMapped, FILE_MAPPED) | |||
78 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) | 85 | CLEARPCGFLAG(FileMapped, FILE_MAPPED) |
79 | TESTPCGFLAG(FileMapped, FILE_MAPPED) | 86 | TESTPCGFLAG(FileMapped, FILE_MAPPED) |
80 | 87 | ||
88 | SETPCGFLAG(FileDirty, FILE_DIRTY) | ||
89 | CLEARPCGFLAG(FileDirty, FILE_DIRTY) | ||
90 | TESTPCGFLAG(FileDirty, FILE_DIRTY) | ||
91 | TESTCLEARPCGFLAG(FileDirty, FILE_DIRTY) | ||
92 | TESTSETPCGFLAG(FileDirty, FILE_DIRTY) | ||
93 | |||
94 | SETPCGFLAG(FileWriteback, FILE_WRITEBACK) | ||
95 | CLEARPCGFLAG(FileWriteback, FILE_WRITEBACK) | ||
96 | TESTPCGFLAG(FileWriteback, FILE_WRITEBACK) | ||
97 | |||
98 | SETPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS) | ||
99 | CLEARPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS) | ||
100 | TESTPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS) | ||
101 | TESTCLEARPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS) | ||
102 | TESTSETPCGFLAG(FileUnstableNFS, FILE_UNSTABLE_NFS) | ||
103 | |||
81 | SETPCGFLAG(Migration, MIGRATION) | 104 | SETPCGFLAG(Migration, MIGRATION) |
82 | CLEARPCGFLAG(Migration, MIGRATION) | 105 | CLEARPCGFLAG(Migration, MIGRATION) |
83 | TESTPCGFLAG(Migration, MIGRATION) | 106 | TESTPCGFLAG(Migration, MIGRATION) |