projects/linux·commit eacaa1f5

[PATCH] cpuset crapectomy

eacaa1f5 · Al Viro <[email protected]> · 2005-09-30 03:26:43 +01:00

Switched cpuset_common_file_read() to simple_read_from_buffer(), killed
a bunch of useless (and not quite correct - e.g.  min(size_t,ssize_t))
code.

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
eacaa1f5aa4a41a48349f55abcd9258506943e76
Parents
46d7031e

Changes

1 files changed · +1 −11

FileStatusAddDelContent
kernel/cpuset.cmodified+1−11View file

kernel/cpuset.c

View file
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 6a6e87b..45a5719 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -968,8 +968,6 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf,
char *page;
ssize_t retval = 0;
char *s;
- char *start;
- ssize_t n;
if (!(page = (char *)__get_free_page(GFP_KERNEL)))
return -ENOMEM;
@@ -999,15 +997,7 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf,
*s++ = '\n';
*s = '\0';
- start = page + *ppos;
- n = s - start;
-
- /* Do nothing if *ppos is at the eof or beyond the eof. */
- if (n <= 0)
- goto out;
-
- retval = n - copy_to_user(buf, start, min(n, nbytes));
- *ppos += retval;
+ retval = simple_read_from_buffer(buf, nbytes, ppos, page, s - page);
out:
free_page((unsigned long)page);
return retval;