diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-05-06 14:51:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 12:13:03 -0700 |
commit | a6ea4cceed18edebe1eb6001cb9e0f88cd741a6c (patch) | |
tree | 4a747a92c9bd7a8703004603ee9e91f8bfb7e95a /arch/um/os-Linux | |
parent | a263672424e591067e42e1d8371e56927fe73af8 (diff) |
uml: rename os_{read_write}_file_k back to os_{read_write}_file
Rename os_{read_write}_file_k back to os_{read_write}_file, delete
the originals and their bogus infrastructure, and fix all the callers.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r-- | arch/um/os-Linux/file.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 5e9b8dcf34d4..6f92f732d253 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c @@ -290,52 +290,8 @@ int os_seek_file(int fd, __u64 offset) return 0; } -static int fault_buffer(void *start, int len, - int (*copy_proc)(void *addr, void *buf, int len)) -{ - int page = getpagesize(), i; - char c; - - for(i = 0; i < len; i += page){ - if((*copy_proc)(start + i, &c, sizeof(c))) - return -EFAULT; - } - if((len % page) != 0){ - if((*copy_proc)(start + len - 1, &c, sizeof(c))) - return -EFAULT; - } - return 0; -} - -static int file_io(int fd, void *buf, int len, - int (*io_proc)(int fd, void *buf, int len), - int (*copy_user_proc)(void *addr, void *buf, int len)) -{ - int n, err; - - do { - n = (*io_proc)(fd, buf, len); - if((n < 0) && (errno == EFAULT)){ - err = fault_buffer(buf, len, copy_user_proc); - if(err) - return err; - n = (*io_proc)(fd, buf, len); - } - } while((n < 0) && (errno == EINTR)); - - if(n < 0) - return -errno; - return n; -} - int os_read_file(int fd, void *buf, int len) { - return file_io(fd, buf, len, (int (*)(int, void *, int)) read, - copy_from_user_proc); -} - -int os_read_file_k(int fd, void *buf, int len) -{ int n = read(fd, buf, len); if(n < 0) @@ -345,12 +301,6 @@ int os_read_file_k(int fd, void *buf, int len) int os_write_file(int fd, const void *buf, int len) { - return file_io(fd, (void *) buf, len, - (int (*)(int, void *, int)) write, copy_to_user_proc); -} - -int os_write_file_k(int fd, const void *buf, int len) -{ int n = write(fd, (void *) buf, len); if(n < 0) |