diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2005-09-30 03:26:43 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-30 08:42:24 -0700 |
commit | eacaa1f5aa4a41a48349f55abcd9258506943e76 (patch) | |
tree | 6b0e7e82f0ba4144639bb30eeb82dc8588cfd3f5 | |
parent | 46d7031ecb8a8360b0022abd8014f38cc1197166 (diff) | |
download | linux-eacaa1f5aa4a41a48349f55abcd9258506943e76.tar.bz2 |
[PATCH] cpuset crapectomy
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 <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/cpuset.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 6a6e87b2f2fd..45a5719a0104 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; |