Skip to content

Commit a6ea4cc

Browse files
cfd-36Linus Torvalds
authored andcommitted
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>
1 parent a263672 commit a6ea4cc

22 files changed

Lines changed: 51 additions & 105 deletions

‎arch/um/drivers/chan_kern.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int generic_read(int fd, char *c_out, void *unused)
9898
{
9999
int n;
100100

101-
n = os_read_file_k(fd, c_out, sizeof(*c_out));
101+
n = os_read_file(fd, c_out, sizeof(*c_out));
102102

103103
if(n == -EAGAIN)
104104
return 0;
@@ -111,7 +111,7 @@ int generic_read(int fd, char *c_out, void *unused)
111111

112112
int generic_write(int fd, const char *buf, int n, void *unused)
113113
{
114-
return os_write_file_k(fd, buf, n);
114+
return os_write_file(fd, buf, n);
115115
}
116116

117117
int generic_window_size(int fd, void *unused, unsigned short *rows_out,

‎arch/um/drivers/chan_user.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static int winch_thread(void *arg)
8585

8686
pty_fd = data->pty_fd;
8787
pipe_fd = data->pipe_fd;
88-
count = os_write_file_k(pipe_fd, &c, sizeof(c));
88+
count = os_write_file(pipe_fd, &c, sizeof(c));
8989
if(count != sizeof(c))
9090
printk("winch_thread : failed to write synchronization "
9191
"byte, err = %d\n", -count);
@@ -120,7 +120,7 @@ static int winch_thread(void *arg)
120120
* host - since they are not different kernel threads, we cannot use
121121
* kernel semaphores. We don't use SysV semaphores because they are
122122
* persistent. */
123-
count = os_read_file_k(pipe_fd, &c, sizeof(c));
123+
count = os_read_file(pipe_fd, &c, sizeof(c));
124124
if(count != sizeof(c))
125125
printk("winch_thread : failed to read synchronization byte, "
126126
"err = %d\n", -count);
@@ -130,7 +130,7 @@ static int winch_thread(void *arg)
130130
* are blocked.*/
131131
sigsuspend(&sigs);
132132

133-
count = os_write_file_k(pipe_fd, &c, sizeof(c));
133+
count = os_write_file(pipe_fd, &c, sizeof(c));
134134
if(count != sizeof(c))
135135
printk("winch_thread : write failed, err = %d\n",
136136
-count);
@@ -162,7 +162,7 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out)
162162
}
163163

164164
*fd_out = fds[0];
165-
n = os_read_file_k(fds[0], &c, sizeof(c));
165+
n = os_read_file(fds[0], &c, sizeof(c));
166166
if(n != sizeof(c)){
167167
printk("winch_tramp : failed to read synchronization byte\n");
168168
printk("read failed, err = %d\n", -n);
@@ -195,7 +195,7 @@ void register_winch(int fd, struct tty_struct *tty)
195195
if(thread > 0){
196196
register_winch_irq(thread_fd, fd, thread, tty);
197197

198-
count = os_write_file_k(thread_fd, &c, sizeof(c));
198+
count = os_write_file(thread_fd, &c, sizeof(c));
199199
if(count != sizeof(c))
200200
printk("register_winch : failed to write "
201201
"synchronization byte, err = %d\n",

‎arch/um/drivers/cow_sys.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static inline int cow_file_size(char *file, unsigned long long *size_out)
3535

3636
static inline int cow_write_file(int fd, void *buf, int size)
3737
{
38-
return os_write_file_k(fd, buf, size);
38+
return os_write_file(fd, buf, size);
3939
}
4040

4141
#endif

‎arch/um/drivers/daemon_user.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@ static int connect_to_switch(struct daemon_data *pri)
9494
req.version = SWITCH_VERSION;
9595
req.type = REQ_NEW_CONTROL;
9696
req.sock = *local_addr;
97-
n = os_write_file_k(pri->control, &req, sizeof(req));
97+
n = os_write_file(pri->control, &req, sizeof(req));
9898
if(n != sizeof(req)){
9999
printk("daemon_open : control setup request failed, err = %d\n",
100100
-n);
101101
err = -ENOTCONN;
102102
goto out_free;
103103
}
104104

105-
n = os_read_file_k(pri->control, sun, sizeof(*sun));
105+
n = os_read_file(pri->control, sun, sizeof(*sun));
106106
if(n != sizeof(*sun)){
107107
printk("daemon_open : read of data socket failed, err = %d\n",
108108
-n);

‎arch/um/drivers/harddog_user.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
7979
goto out_close_out;
8080
}
8181

82-
n = os_read_file_k(in_fds[0], &c, sizeof(c));
82+
n = os_read_file(in_fds[0], &c, sizeof(c));
8383
if(n == 0){
8484
printk("harddog_open - EOF on watchdog pipe\n");
8585
helper_wait(pid);
@@ -118,7 +118,7 @@ int ping_watchdog(int fd)
118118
int n;
119119
char c = '\n';
120120

121-
n = os_write_file_k(fd, &c, sizeof(c));
121+
n = os_write_file(fd, &c, sizeof(c));
122122
if(n != sizeof(c)){
123123
printk("ping_watchdog - write failed, err = %d\n", -n);
124124
if(n < 0)

‎arch/um/drivers/hostaudio_kern.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static ssize_t hostaudio_read(struct file *file, char __user *buffer,
8484
if(kbuf == NULL)
8585
return(-ENOMEM);
8686

87-
err = os_read_file_k(state->fd, kbuf, count);
87+
err = os_read_file(state->fd, kbuf, count);
8888
if(err < 0)
8989
goto out;
9090

@@ -115,7 +115,7 @@ static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
115115
if(copy_from_user(kbuf, buffer, count))
116116
goto out;
117117

118-
err = os_write_file_k(state->fd, kbuf, count);
118+
err = os_write_file(state->fd, kbuf, count);
119119
if(err < 0)
120120
goto out;
121121
*ppos += err;

‎arch/um/drivers/net_user.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void read_output(int fd, char *output, int len)
6363
}
6464

6565
*output = '\0';
66-
ret = os_read_file_k(fd, &remain, sizeof(remain));
66+
ret = os_read_file(fd, &remain, sizeof(remain));
6767

6868
if (ret != sizeof(remain)) {
6969
expected = sizeof(remain);
@@ -73,7 +73,7 @@ void read_output(int fd, char *output, int len)
7373

7474
while(remain != 0){
7575
expected = (remain < len) ? remain : len;
76-
ret = os_read_file_k(fd, output, expected);
76+
ret = os_read_file(fd, output, expected);
7777
if (ret != expected) {
7878
str = "data";
7979
goto err;
@@ -94,7 +94,7 @@ int net_read(int fd, void *buf, int len)
9494
{
9595
int n;
9696

97-
n = os_read_file_k(fd, buf, len);
97+
n = os_read_file(fd, buf, len);
9898

9999
if(n == -EAGAIN)
100100
return 0;
@@ -122,7 +122,7 @@ int net_write(int fd, void *buf, int len)
122122
{
123123
int n;
124124

125-
n = os_write_file_k(fd, buf, len);
125+
n = os_write_file(fd, buf, len);
126126

127127
if(n == -EAGAIN)
128128
return 0;

‎arch/um/drivers/port_kern.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static int port_accept(struct port_list *port)
113113
}
114114

115115
if(atomic_read(&port->wait_count) == 0){
116-
os_write_file_k(fd, NO_WAITER_MSG, sizeof(NO_WAITER_MSG));
116+
os_write_file(fd, NO_WAITER_MSG, sizeof(NO_WAITER_MSG));
117117
printk("No one waiting for port\n");
118118
}
119119
list_add(&conn->list, &port->pending);

‎arch/um/drivers/random.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static ssize_t rng_dev_read (struct file *filp, char __user *buf, size_t size,
4444
int n, ret = 0, have_data;
4545

4646
while(size){
47-
n = os_read_file_k(random_fd, &data, sizeof(data));
47+
n = os_read_file(random_fd, &data, sizeof(data));
4848
if(n > 0){
4949
have_data = n;
5050
while (have_data && size) {

‎arch/um/drivers/ubd_kern.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ static void ubd_handler(void)
511511
int n;
512512

513513
while(1){
514-
n = os_read_file_k(thread_fd, &req,
515-
sizeof(struct io_thread_req *));
514+
n = os_read_file(thread_fd, &req,
515+
sizeof(struct io_thread_req *));
516516
if(n != sizeof(req)){
517517
if(n == -EAGAIN)
518518
break;
@@ -1112,8 +1112,8 @@ static void do_ubd_request(request_queue_t *q)
11121112
(unsigned long long) req->sector << 9,
11131113
sg->offset, sg->length, sg->page);
11141114

1115-
n = os_write_file_k(thread_fd, &io_req,
1116-
sizeof(struct io_thread_req *));
1115+
n = os_write_file(thread_fd, &io_req,
1116+
sizeof(struct io_thread_req *));
11171117
if(n != sizeof(struct io_thread_req *)){
11181118
if(n != -EAGAIN)
11191119
printk("write to io thread failed, "
@@ -1366,8 +1366,8 @@ static int update_bitmap(struct io_thread_req *req)
13661366
return 1;
13671367
}
13681368

1369-
n = os_write_file_k(req->fds[1], &req->bitmap_words,
1370-
sizeof(req->bitmap_words));
1369+
n = os_write_file(req->fds[1], &req->bitmap_words,
1370+
sizeof(req->bitmap_words));
13711371
if(n != sizeof(req->bitmap_words)){
13721372
printk("do_io - bitmap update failed, err = %d fd = %d\n", -n,
13731373
req->fds[1]);
@@ -1411,7 +1411,7 @@ void do_io(struct io_thread_req *req)
14111411
do {
14121412
buf = &buf[n];
14131413
len -= n;
1414-
n = os_read_file_k(req->fds[bit], buf, len);
1414+
n = os_read_file(req->fds[bit], buf, len);
14151415
if (n < 0) {
14161416
printk("do_io - read failed, err = %d "
14171417
"fd = %d\n", -n, req->fds[bit]);
@@ -1421,7 +1421,7 @@ void do_io(struct io_thread_req *req)
14211421
} while((n < len) && (n != 0));
14221422
if (n < len) memset(&buf[n], 0, len - n);
14231423
} else {
1424-
n = os_write_file_k(req->fds[bit], buf, len);
1424+
n = os_write_file(req->fds[bit], buf, len);
14251425
if(n != len){
14261426
printk("do_io - write failed err = %d "
14271427
"fd = %d\n", -n, req->fds[bit]);
@@ -1451,7 +1451,7 @@ int io_thread(void *arg)
14511451

14521452
ignore_sigwinch_sig();
14531453
while(1){
1454-
n = os_read_file_k(kernel_fd, &req,
1454+
n = os_read_file(kernel_fd, &req,
14551455
sizeof(struct io_thread_req *));
14561456
if(n != sizeof(struct io_thread_req *)){
14571457
if(n < 0)
@@ -1465,7 +1465,7 @@ int io_thread(void *arg)
14651465
}
14661466
io_count++;
14671467
do_io(req);
1468-
n = os_write_file_k(kernel_fd, &req,
1468+
n = os_write_file(kernel_fd, &req,
14691469
sizeof(struct io_thread_req *));
14701470
if(n != sizeof(struct io_thread_req *))
14711471
printk("io_thread - write failed, fd = %d, err = %d\n",

0 commit comments

Comments
 (0)