提交 fda83a99 编写于 作者: J Jeff Dike 提交者: Linus Torvalds

uml: change remaining callers of os_{read_write}_file

Convert all remaining os_{read_write}_file users to use the simple
{read,write} wrappers, os_{read_write}_file_k.
Signed-off-by: NJeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 77f6af77
...@@ -98,7 +98,7 @@ int generic_read(int fd, char *c_out, void *unused) ...@@ -98,7 +98,7 @@ int generic_read(int fd, char *c_out, void *unused)
{ {
int n; int n;
n = os_read_file(fd, c_out, sizeof(*c_out)); n = os_read_file_k(fd, c_out, sizeof(*c_out));
if(n == -EAGAIN) if(n == -EAGAIN)
return 0; return 0;
...@@ -111,7 +111,7 @@ int generic_read(int fd, char *c_out, void *unused) ...@@ -111,7 +111,7 @@ int generic_read(int fd, char *c_out, void *unused)
int generic_write(int fd, const char *buf, int n, void *unused) int generic_write(int fd, const char *buf, int n, void *unused)
{ {
return os_write_file(fd, buf, n); return os_write_file_k(fd, buf, n);
} }
int generic_window_size(int fd, void *unused, unsigned short *rows_out, int generic_window_size(int fd, void *unused, unsigned short *rows_out,
......
...@@ -35,7 +35,7 @@ static inline int cow_file_size(char *file, unsigned long long *size_out) ...@@ -35,7 +35,7 @@ static inline int cow_file_size(char *file, unsigned long long *size_out)
static inline int cow_write_file(int fd, void *buf, int size) static inline int cow_write_file(int fd, void *buf, int size)
{ {
return(os_write_file(fd, buf, size)); return(os_write_file_k(fd, buf, size));
} }
#endif #endif
......
...@@ -73,7 +73,7 @@ void read_output(int fd, char *output, int len) ...@@ -73,7 +73,7 @@ void read_output(int fd, char *output, int len)
while(remain != 0){ while(remain != 0){
expected = (remain < len) ? remain : len; expected = (remain < len) ? remain : len;
ret = os_read_file(fd, output, expected); ret = os_read_file_k(fd, output, expected);
if (ret != expected) { if (ret != expected) {
str = "data"; str = "data";
goto err; goto err;
...@@ -94,7 +94,7 @@ int net_read(int fd, void *buf, int len) ...@@ -94,7 +94,7 @@ int net_read(int fd, void *buf, int len)
{ {
int n; int n;
n = os_read_file(fd, buf, len); n = os_read_file_k(fd, buf, len);
if(n == -EAGAIN) if(n == -EAGAIN)
return 0; return 0;
...@@ -122,7 +122,7 @@ int net_write(int fd, void *buf, int len) ...@@ -122,7 +122,7 @@ int net_write(int fd, void *buf, int len)
{ {
int n; int n;
n = os_write_file(fd, buf, len); n = os_write_file_k(fd, buf, len);
if(n == -EAGAIN) if(n == -EAGAIN)
return 0; return 0;
......
...@@ -1246,7 +1246,7 @@ int read_cow_bitmap(int fd, void *buf, int offset, int len) ...@@ -1246,7 +1246,7 @@ int read_cow_bitmap(int fd, void *buf, int offset, int len)
if(err < 0) if(err < 0)
return(err); return(err);
err = os_read_file(fd, buf, len); err = os_read_file_k(fd, buf, len);
if(err < 0) if(err < 0)
return(err); return(err);
......
...@@ -55,7 +55,7 @@ int load_initrd(char *filename, void *buf, int size) ...@@ -55,7 +55,7 @@ int load_initrd(char *filename, void *buf, int size)
printk("Opening '%s' failed - err = %d\n", filename, -fd); printk("Opening '%s' failed - err = %d\n", filename, -fd);
return(-1); return(-1);
} }
n = os_read_file(fd, buf, size); n = os_read_file_k(fd, buf, size);
if(n != size){ if(n != size){
printk("Read of %d bytes from '%s' failed, err = %d\n", size, printk("Read of %d bytes from '%s' failed, err = %d\n", size,
filename, -n); filename, -n);
......
...@@ -211,7 +211,7 @@ void physmem_forget_descriptor(int fd) ...@@ -211,7 +211,7 @@ void physmem_forget_descriptor(int fd)
panic("physmem_forget_descriptor - failed to seek " panic("physmem_forget_descriptor - failed to seek "
"to %lld in fd %d, error = %d\n", "to %lld in fd %d, error = %d\n",
offset, fd, -err); offset, fd, -err);
err = os_read_file(fd, addr, PAGE_SIZE); err = os_read_file_k(fd, addr, PAGE_SIZE);
if(err < 0) if(err < 0)
panic("physmem_forget_descriptor - failed to read " panic("physmem_forget_descriptor - failed to read "
"from fd %d to 0x%p, error = %d\n", "from fd %d to 0x%p, error = %d\n",
......
...@@ -28,7 +28,7 @@ static char token(int fd, char *buf, int len, char stop) ...@@ -28,7 +28,7 @@ static char token(int fd, char *buf, int len, char stop)
ptr = buf; ptr = buf;
end = &buf[len]; end = &buf[len];
do { do {
n = os_read_file(fd, ptr, sizeof(*ptr)); n = os_read_file_k(fd, ptr, sizeof(*ptr));
c = *ptr++; c = *ptr++;
if(n != sizeof(*ptr)){ if(n != sizeof(*ptr)){
if(n == 0) if(n == 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册