diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
commit | f43dc23d5ea91fca257be02138a255f02d98e806 (patch) | |
tree | b29722f6e965316e90ac97abf79923ced250dc21 /fs/proc/page.c | |
parent | f8e53553f452dcbf67cb89c8cba63a1cd6eb4cc0 (diff) | |
parent | 4162cf64973df51fc885825bc9ca4d055891c49f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into common/serial-rework
Conflicts:
arch/sh/kernel/cpu/sh2/setup-sh7619.c
arch/sh/kernel/cpu/sh2a/setup-mxg.c
arch/sh/kernel/cpu/sh2a/setup-sh7201.c
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
arch/sh/kernel/cpu/sh3/setup-sh7705.c
arch/sh/kernel/cpu/sh3/setup-sh770x.c
arch/sh/kernel/cpu/sh3/setup-sh7710.c
arch/sh/kernel/cpu/sh3/setup-sh7720.c
arch/sh/kernel/cpu/sh4/setup-sh4-202.c
arch/sh/kernel/cpu/sh4/setup-sh7750.c
arch/sh/kernel/cpu/sh4/setup-sh7760.c
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
arch/sh/kernel/cpu/sh4a/setup-sh7780.c
arch/sh/kernel/cpu/sh4a/setup-sh7785.c
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
arch/sh/kernel/cpu/sh4a/setup-shx3.c
arch/sh/kernel/cpu/sh5/setup-sh5.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
include/linux/serial_sci.h
Diffstat (limited to 'fs/proc/page.c')
-rw-r--r-- | fs/proc/page.c | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/fs/proc/page.c b/fs/proc/page.c index 2707c6c7a20f..3b8b45660331 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c | |||
@@ -2,11 +2,13 @@ | |||
2 | #include <linux/compiler.h> | 2 | #include <linux/compiler.h> |
3 | #include <linux/fs.h> | 3 | #include <linux/fs.h> |
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | #include <linux/ksm.h> | ||
5 | #include <linux/mm.h> | 6 | #include <linux/mm.h> |
6 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
7 | #include <linux/proc_fs.h> | 8 | #include <linux/proc_fs.h> |
8 | #include <linux/seq_file.h> | 9 | #include <linux/seq_file.h> |
9 | #include <linux/hugetlb.h> | 10 | #include <linux/hugetlb.h> |
11 | #include <linux/kernel-page-flags.h> | ||
10 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
11 | #include "internal.h" | 13 | #include "internal.h" |
12 | 14 | ||
@@ -70,49 +72,12 @@ static const struct file_operations proc_kpagecount_operations = { | |||
70 | * physical page flags. | 72 | * physical page flags. |
71 | */ | 73 | */ |
72 | 74 | ||
73 | /* These macros are used to decouple internal flags from exported ones */ | ||
74 | |||
75 | #define KPF_LOCKED 0 | ||
76 | #define KPF_ERROR 1 | ||
77 | #define KPF_REFERENCED 2 | ||
78 | #define KPF_UPTODATE 3 | ||
79 | #define KPF_DIRTY 4 | ||
80 | #define KPF_LRU 5 | ||
81 | #define KPF_ACTIVE 6 | ||
82 | #define KPF_SLAB 7 | ||
83 | #define KPF_WRITEBACK 8 | ||
84 | #define KPF_RECLAIM 9 | ||
85 | #define KPF_BUDDY 10 | ||
86 | |||
87 | /* 11-20: new additions in 2.6.31 */ | ||
88 | #define KPF_MMAP 11 | ||
89 | #define KPF_ANON 12 | ||
90 | #define KPF_SWAPCACHE 13 | ||
91 | #define KPF_SWAPBACKED 14 | ||
92 | #define KPF_COMPOUND_HEAD 15 | ||
93 | #define KPF_COMPOUND_TAIL 16 | ||
94 | #define KPF_HUGE 17 | ||
95 | #define KPF_UNEVICTABLE 18 | ||
96 | #define KPF_NOPAGE 20 | ||
97 | |||
98 | /* kernel hacking assistances | ||
99 | * WARNING: subject to change, never rely on them! | ||
100 | */ | ||
101 | #define KPF_RESERVED 32 | ||
102 | #define KPF_MLOCKED 33 | ||
103 | #define KPF_MAPPEDTODISK 34 | ||
104 | #define KPF_PRIVATE 35 | ||
105 | #define KPF_PRIVATE_2 36 | ||
106 | #define KPF_OWNER_PRIVATE 37 | ||
107 | #define KPF_ARCH 38 | ||
108 | #define KPF_UNCACHED 39 | ||
109 | |||
110 | static inline u64 kpf_copy_bit(u64 kflags, int ubit, int kbit) | 75 | static inline u64 kpf_copy_bit(u64 kflags, int ubit, int kbit) |
111 | { | 76 | { |
112 | return ((kflags >> kbit) & 1) << ubit; | 77 | return ((kflags >> kbit) & 1) << ubit; |
113 | } | 78 | } |
114 | 79 | ||
115 | static u64 get_uflags(struct page *page) | 80 | u64 stable_page_flags(struct page *page) |
116 | { | 81 | { |
117 | u64 k; | 82 | u64 k; |
118 | u64 u; | 83 | u64 u; |
@@ -137,6 +102,8 @@ static u64 get_uflags(struct page *page) | |||
137 | u |= 1 << KPF_MMAP; | 102 | u |= 1 << KPF_MMAP; |
138 | if (PageAnon(page)) | 103 | if (PageAnon(page)) |
139 | u |= 1 << KPF_ANON; | 104 | u |= 1 << KPF_ANON; |
105 | if (PageKsm(page)) | ||
106 | u |= 1 << KPF_KSM; | ||
140 | 107 | ||
141 | /* | 108 | /* |
142 | * compound pages: export both head/tail info | 109 | * compound pages: export both head/tail info |
@@ -175,7 +142,11 @@ static u64 get_uflags(struct page *page) | |||
175 | u |= kpf_copy_bit(k, KPF_UNEVICTABLE, PG_unevictable); | 142 | u |= kpf_copy_bit(k, KPF_UNEVICTABLE, PG_unevictable); |
176 | u |= kpf_copy_bit(k, KPF_MLOCKED, PG_mlocked); | 143 | u |= kpf_copy_bit(k, KPF_MLOCKED, PG_mlocked); |
177 | 144 | ||
178 | #ifdef CONFIG_IA64_UNCACHED_ALLOCATOR | 145 | #ifdef CONFIG_MEMORY_FAILURE |
146 | u |= kpf_copy_bit(k, KPF_HWPOISON, PG_hwpoison); | ||
147 | #endif | ||
148 | |||
149 | #ifdef CONFIG_ARCH_USES_PG_UNCACHED | ||
179 | u |= kpf_copy_bit(k, KPF_UNCACHED, PG_uncached); | 150 | u |= kpf_copy_bit(k, KPF_UNCACHED, PG_uncached); |
180 | #endif | 151 | #endif |
181 | 152 | ||
@@ -209,7 +180,7 @@ static ssize_t kpageflags_read(struct file *file, char __user *buf, | |||
209 | else | 180 | else |
210 | ppage = NULL; | 181 | ppage = NULL; |
211 | 182 | ||
212 | if (put_user(get_uflags(ppage), out)) { | 183 | if (put_user(stable_page_flags(ppage), out)) { |
213 | ret = -EFAULT; | 184 | ret = -EFAULT; |
214 | break; | 185 | break; |
215 | } | 186 | } |