Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151550
b: refs/heads/master
c: ed7ce0f
h: refs/heads/master
v: v3
  • Loading branch information
Wu Fengguang authored and Linus Torvalds committed Jun 17, 2009
1 parent dc90b4b commit c3dbcff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 20a0307c0396c2edb651401d2f2db193dda2f3c9
refs/heads/master: ed7ce0f1022942301776f93159c981b09382ddea
17 changes: 11 additions & 6 deletions trunk/fs/proc/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#define KPMSIZE sizeof(u64)
#define KPMMASK (KPMSIZE - 1)

/* /proc/kpagecount - an array exposing page counts
*
* Each entry is a u64 representing the corresponding
Expand All @@ -33,20 +34,22 @@ static ssize_t kpagecount_read(struct file *file, char __user *buf,
return -EINVAL;

while (count > 0) {
ppage = NULL;
if (pfn_valid(pfn))
ppage = pfn_to_page(pfn);
pfn++;
else
ppage = NULL;
if (!ppage)
pcount = 0;
else
pcount = page_mapcount(ppage);

if (put_user(pcount, out++)) {
if (put_user(pcount, out)) {
ret = -EFAULT;
break;
}

pfn++;
out++;
count -= KPMSIZE;
}

Expand Down Expand Up @@ -99,10 +102,10 @@ static ssize_t kpageflags_read(struct file *file, char __user *buf,
return -EINVAL;

while (count > 0) {
ppage = NULL;
if (pfn_valid(pfn))
ppage = pfn_to_page(pfn);
pfn++;
else
ppage = NULL;
if (!ppage)
kflags = 0;
else
Expand All @@ -120,11 +123,13 @@ static ssize_t kpageflags_read(struct file *file, char __user *buf,
kpf_copy_bit(kflags, KPF_RECLAIM, PG_reclaim) |
kpf_copy_bit(kflags, KPF_BUDDY, PG_buddy);

if (put_user(uflags, out++)) {
if (put_user(uflags, out)) {
ret = -EFAULT;
break;
}

pfn++;
out++;
count -= KPMSIZE;
}

Expand Down

0 comments on commit c3dbcff

Please sign in to comment.