diff options
| author | 2019-10-27 18:54:13 +0100 | |
|---|---|---|
| committer | 2019-10-27 18:54:13 +0100 | |
| commit | 8f677bc819e7a74cf10e30daf06e8b151d1e6a94 (patch) | |
| tree | 379e4e32a06dfb6d2ca3519ca4ef6b7507fad197 /fs/proc/page.c | |
| parent | docs: driver-model: Add documentation for sync_state (diff) | |
| parent | Linux 5.4-rc5 (diff) | |
| download | wireguard-linux-8f677bc819e7a74cf10e30daf06e8b151d1e6a94.tar.xz wireguard-linux-8f677bc819e7a74cf10e30daf06e8b151d1e6a94.zip | |
Merge 5.4-rc5 into driver-core-next
We want the sysfs fix in here as well to build on top of.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/proc/page.c')
| -rw-r--r-- | fs/proc/page.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/fs/proc/page.c b/fs/proc/page.c index 544d1ee15aee..7c952ee732e6 100644 --- a/fs/proc/page.c +++ b/fs/proc/page.c @@ -42,10 +42,12 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf, return -EINVAL; while (count > 0) { - if (pfn_valid(pfn)) - ppage = pfn_to_page(pfn); - else - ppage = NULL; + /* + * TODO: ZONE_DEVICE support requires to identify + * memmaps that were actually initialized. + */ + ppage = pfn_to_online_page(pfn); + if (!ppage || PageSlab(ppage) || page_has_type(ppage)) pcount = 0; else @@ -216,10 +218,11 @@ static ssize_t kpageflags_read(struct file *file, char __user *buf, return -EINVAL; while (count > 0) { - if (pfn_valid(pfn)) - ppage = pfn_to_page(pfn); - else - ppage = NULL; + /* + * TODO: ZONE_DEVICE support requires to identify + * memmaps that were actually initialized. + */ + ppage = pfn_to_online_page(pfn); if (put_user(stable_page_flags(ppage), out)) { ret = -EFAULT; @@ -261,10 +264,11 @@ static ssize_t kpagecgroup_read(struct file *file, char __user *buf, return -EINVAL; while (count > 0) { - if (pfn_valid(pfn)) - ppage = pfn_to_page(pfn); - else - ppage = NULL; + /* + * TODO: ZONE_DEVICE support requires to identify + * memmaps that were actually initialized. + */ + ppage = pfn_to_online_page(pfn); if (ppage) ino = page_cgroup_ino(ppage); |
