aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2005-09-29 22:26:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-30 11:42:24 -0400
commiteacaa1f5aa4a41a48349f55abcd9258506943e76 (patch)
tree6b0e7e82f0ba4144639bb30eeb82dc8588cfd3f5 /kernel
parent46d7031ecb8a8360b0022abd8014f38cc1197166 (diff)
[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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c12
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,
968 char *page; 968 char *page;
969 ssize_t retval = 0; 969 ssize_t retval = 0;
970 char *s; 970 char *s;
971 char *start;
972 ssize_t n;
973 971
974 if (!(page = (char *)__get_free_page(GFP_KERNEL))) 972 if (!(page = (char *)__get_free_page(GFP_KERNEL)))
975 return -ENOMEM; 973 return -ENOMEM;
@@ -999,15 +997,7 @@ static ssize_t cpuset_common_file_read(struct file *file, char __user *buf,
999 *s++ = '\n'; 997 *s++ = '\n';
1000 *s = '\0'; 998 *s = '\0';
1001 999
1002 start = page + *ppos; 1000 retval = simple_read_from_buffer(buf, nbytes, ppos, page, s - page);
1003 n = s - start;
1004
1005 /* Do nothing if *ppos is at the eof or beyond the eof. */
1006 if (n <= 0)
1007 goto out;
1008
1009 retval = n - copy_to_user(buf, start, min(n, nbytes));
1010 *ppos += retval;
1011out: 1001out:
1012 free_page((unsigned long)page); 1002 free_page((unsigned long)page);
1013 return retval; 1003 return retval;