Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359291
b: refs/heads/master
c: c2c1b08
h: refs/heads/master
i:
  359289: 0dc15e7
  359287: 7c5319e
v: v3
  • Loading branch information
Zhang Yanfei authored and Linus Torvalds committed Feb 28, 2013
1 parent ffe2844 commit a72f3f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 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: 87ebdc00eeb474615496d5f10eed46709e25c707
refs/heads/master: c2c1b089b44b783bd50fae4bccaa6f367f92e492
20 changes: 7 additions & 13 deletions trunk/fs/proc/vmcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
start = map_offset_to_paddr(*fpos, &vmcore_list, &curr_m);
if (!curr_m)
return -EINVAL;
if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
tsz = buflen;

/* Calculate left bytes in current memory segment. */
nr_bytes = (curr_m->size - (start - curr_m->paddr));
if (tsz > nr_bytes)
tsz = nr_bytes;

while (buflen) {
tsz = min_t(size_t, buflen, PAGE_SIZE - (start & ~PAGE_MASK));

/* Calculate left bytes in current memory segment. */
nr_bytes = (curr_m->size - (start - curr_m->paddr));
if (tsz > nr_bytes)
tsz = nr_bytes;

tmp = read_from_oldmem(buffer, tsz, &start, 1);
if (tmp < 0)
return tmp;
Expand All @@ -199,12 +199,6 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
struct vmcore, list);
start = curr_m->paddr;
}
if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
tsz = buflen;
/* Calculate left bytes in current memory segment. */
nr_bytes = (curr_m->size - (start - curr_m->paddr));
if (tsz > nr_bytes)
tsz = nr_bytes;
}
return acc;
}
Expand Down

0 comments on commit a72f3f0

Please sign in to comment.