diff options
Diffstat (limited to 'arch/um/drivers')
-rw-r--r-- | arch/um/drivers/line.c | 28 | ||||
-rw-r--r-- | arch/um/drivers/mconsole_kern.c | 55 | ||||
-rw-r--r-- | arch/um/drivers/mconsole_user.c | 5 | ||||
-rw-r--r-- | arch/um/drivers/net_kern.c | 16 | ||||
-rw-r--r-- | arch/um/drivers/net_user.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/port_kern.c | 7 | ||||
-rw-r--r-- | arch/um/drivers/random.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/slip_user.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/slirp_user.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/ssl.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/stdio_console.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/ubd_kern.c | 30 | ||||
-rw-r--r-- | arch/um/drivers/ubd_user.c | 1 | ||||
-rw-r--r-- | arch/um/drivers/vde_user.c | 2 |
14 files changed, 71 insertions, 82 deletions
diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c index 83bf15a3dda8..2c898c4d6b6a 100644 --- a/arch/um/drivers/line.c +++ b/arch/um/drivers/line.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "chan_kern.h" | 8 | #include "chan_kern.h" |
9 | #include "irq_kern.h" | 9 | #include "irq_kern.h" |
10 | #include "irq_user.h" | 10 | #include "irq_user.h" |
11 | #include "kern_util.h" | ||
11 | #include "os.h" | 12 | #include "os.h" |
12 | 13 | ||
13 | #define LINE_BUFSIZE 4096 | 14 | #define LINE_BUFSIZE 4096 |
@@ -48,7 +49,7 @@ static int write_room(struct line *line) | |||
48 | n = line->head - line->tail; | 49 | n = line->head - line->tail; |
49 | 50 | ||
50 | if (n <= 0) | 51 | if (n <= 0) |
51 | n = LINE_BUFSIZE + n; /* The other case */ | 52 | n += LINE_BUFSIZE; /* The other case */ |
52 | return n - 1; | 53 | return n - 1; |
53 | } | 54 | } |
54 | 55 | ||
@@ -58,17 +59,10 @@ int line_write_room(struct tty_struct *tty) | |||
58 | unsigned long flags; | 59 | unsigned long flags; |
59 | int room; | 60 | int room; |
60 | 61 | ||
61 | if (tty->stopped) | ||
62 | return 0; | ||
63 | |||
64 | spin_lock_irqsave(&line->lock, flags); | 62 | spin_lock_irqsave(&line->lock, flags); |
65 | room = write_room(line); | 63 | room = write_room(line); |
66 | spin_unlock_irqrestore(&line->lock, flags); | 64 | spin_unlock_irqrestore(&line->lock, flags); |
67 | 65 | ||
68 | /*XXX: Warning to remove */ | ||
69 | if (0 == room) | ||
70 | printk(KERN_DEBUG "%s: %s: no room left in buffer\n", | ||
71 | __FUNCTION__,tty->name); | ||
72 | return room; | 66 | return room; |
73 | } | 67 | } |
74 | 68 | ||
@@ -79,8 +73,7 @@ int line_chars_in_buffer(struct tty_struct *tty) | |||
79 | int ret; | 73 | int ret; |
80 | 74 | ||
81 | spin_lock_irqsave(&line->lock, flags); | 75 | spin_lock_irqsave(&line->lock, flags); |
82 | 76 | /* write_room subtracts 1 for the needed NULL, so we readd it.*/ | |
83 | /*write_room subtracts 1 for the needed NULL, so we readd it.*/ | ||
84 | ret = LINE_BUFSIZE - (write_room(line) + 1); | 77 | ret = LINE_BUFSIZE - (write_room(line) + 1); |
85 | spin_unlock_irqrestore(&line->lock, flags); | 78 | spin_unlock_irqrestore(&line->lock, flags); |
86 | 79 | ||
@@ -184,10 +177,6 @@ void line_flush_buffer(struct tty_struct *tty) | |||
184 | unsigned long flags; | 177 | unsigned long flags; |
185 | int err; | 178 | int err; |
186 | 179 | ||
187 | /*XXX: copied from line_write, verify if it is correct!*/ | ||
188 | if (tty->stopped) | ||
189 | return; | ||
190 | |||
191 | spin_lock_irqsave(&line->lock, flags); | 180 | spin_lock_irqsave(&line->lock, flags); |
192 | err = flush_buffer(line); | 181 | err = flush_buffer(line); |
193 | spin_unlock_irqrestore(&line->lock, flags); | 182 | spin_unlock_irqrestore(&line->lock, flags); |
@@ -213,9 +202,6 @@ int line_write(struct tty_struct *tty, const unsigned char *buf, int len) | |||
213 | unsigned long flags; | 202 | unsigned long flags; |
214 | int n, ret = 0; | 203 | int n, ret = 0; |
215 | 204 | ||
216 | if (tty->stopped) | ||
217 | return 0; | ||
218 | |||
219 | spin_lock_irqsave(&line->lock, flags); | 205 | spin_lock_irqsave(&line->lock, flags); |
220 | if (line->head != line->tail) | 206 | if (line->head != line->tail) |
221 | ret = buffer_data(line, buf, len); | 207 | ret = buffer_data(line, buf, len); |
@@ -788,9 +774,11 @@ static irqreturn_t winch_interrupt(int irq, void *data) | |||
788 | tty = winch->tty; | 774 | tty = winch->tty; |
789 | if (tty != NULL) { | 775 | if (tty != NULL) { |
790 | line = tty->driver_data; | 776 | line = tty->driver_data; |
791 | chan_window_size(&line->chan_list, &tty->winsize.ws_row, | 777 | if (line != NULL) { |
792 | &tty->winsize.ws_col); | 778 | chan_window_size(&line->chan_list, &tty->winsize.ws_row, |
793 | kill_pgrp(tty->pgrp, SIGWINCH, 1); | 779 | &tty->winsize.ws_col); |
780 | kill_pgrp(tty->pgrp, SIGWINCH, 1); | ||
781 | } | ||
794 | } | 782 | } |
795 | out: | 783 | out: |
796 | if (winch->fd != -1) | 784 | if (winch->fd != -1) |
diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c index 0f3c7d14a6e3..ebb265c07e4d 100644 --- a/arch/um/drivers/mconsole_kern.c +++ b/arch/um/drivers/mconsole_kern.c | |||
@@ -1,23 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) | 2 | * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) |
3 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | 3 | * Copyright (C) 2001 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
4 | * Licensed under the GPL | 4 | * Licensed under the GPL |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include "linux/console.h" | 7 | #include <linux/console.h> |
8 | #include "linux/ctype.h" | 8 | #include <linux/ctype.h> |
9 | #include "linux/interrupt.h" | 9 | #include <linux/interrupt.h> |
10 | #include "linux/list.h" | 10 | #include <linux/list.h> |
11 | #include "linux/mm.h" | 11 | #include <linux/mm.h> |
12 | #include "linux/module.h" | 12 | #include <linux/module.h> |
13 | #include "linux/notifier.h" | 13 | #include <linux/notifier.h> |
14 | #include "linux/reboot.h" | 14 | #include <linux/reboot.h> |
15 | #include "linux/proc_fs.h" | 15 | #include <linux/proc_fs.h> |
16 | #include "linux/slab.h" | 16 | #include <linux/slab.h> |
17 | #include "linux/syscalls.h" | 17 | #include <linux/syscalls.h> |
18 | #include "linux/utsname.h" | 18 | #include <linux/utsname.h> |
19 | #include "linux/workqueue.h" | 19 | #include <linux/workqueue.h> |
20 | #include "asm/uaccess.h" | 20 | #include <linux/mutex.h> |
21 | #include <asm/uaccess.h> | ||
22 | |||
21 | #include "init.h" | 23 | #include "init.h" |
22 | #include "irq_kern.h" | 24 | #include "irq_kern.h" |
23 | #include "irq_user.h" | 25 | #include "irq_user.h" |
@@ -305,7 +307,9 @@ void mconsole_stop(struct mc_request *req) | |||
305 | deactivate_fd(req->originating_fd, MCONSOLE_IRQ); | 307 | deactivate_fd(req->originating_fd, MCONSOLE_IRQ); |
306 | os_set_fd_block(req->originating_fd, 1); | 308 | os_set_fd_block(req->originating_fd, 1); |
307 | mconsole_reply(req, "stopped", 0, 0); | 309 | mconsole_reply(req, "stopped", 0, 0); |
308 | while (mconsole_get_request(req->originating_fd, req)) { | 310 | for (;;) { |
311 | if (!mconsole_get_request(req->originating_fd, req)) | ||
312 | continue; | ||
309 | if (req->cmd->handler == mconsole_go) | 313 | if (req->cmd->handler == mconsole_go) |
310 | break; | 314 | break; |
311 | if (req->cmd->handler == mconsole_stop) { | 315 | if (req->cmd->handler == mconsole_stop) { |
@@ -358,7 +362,7 @@ struct unplugged_pages { | |||
358 | void *pages[UNPLUGGED_PER_PAGE]; | 362 | void *pages[UNPLUGGED_PER_PAGE]; |
359 | }; | 363 | }; |
360 | 364 | ||
361 | static DECLARE_MUTEX(plug_mem_mutex); | 365 | static DEFINE_MUTEX(plug_mem_mutex); |
362 | static unsigned long long unplugged_pages_count = 0; | 366 | static unsigned long long unplugged_pages_count = 0; |
363 | static LIST_HEAD(unplugged_pages); | 367 | static LIST_HEAD(unplugged_pages); |
364 | static int unplug_index = UNPLUGGED_PER_PAGE; | 368 | static int unplug_index = UNPLUGGED_PER_PAGE; |
@@ -394,7 +398,7 @@ static int mem_config(char *str, char **error_out) | |||
394 | 398 | ||
395 | diff /= PAGE_SIZE; | 399 | diff /= PAGE_SIZE; |
396 | 400 | ||
397 | down(&plug_mem_mutex); | 401 | mutex_lock(&plug_mem_mutex); |
398 | for (i = 0; i < diff; i++) { | 402 | for (i = 0; i < diff; i++) { |
399 | struct unplugged_pages *unplugged; | 403 | struct unplugged_pages *unplugged; |
400 | void *addr; | 404 | void *addr; |
@@ -451,7 +455,7 @@ static int mem_config(char *str, char **error_out) | |||
451 | 455 | ||
452 | err = 0; | 456 | err = 0; |
453 | out_unlock: | 457 | out_unlock: |
454 | up(&plug_mem_mutex); | 458 | mutex_unlock(&plug_mem_mutex); |
455 | out: | 459 | out: |
456 | return err; | 460 | return err; |
457 | } | 461 | } |
@@ -741,7 +745,6 @@ void mconsole_stack(struct mc_request *req) | |||
741 | { | 745 | { |
742 | char *ptr = req->request.data; | 746 | char *ptr = req->request.data; |
743 | int pid_requested= -1; | 747 | int pid_requested= -1; |
744 | struct task_struct *from = NULL; | ||
745 | struct task_struct *to = NULL; | 748 | struct task_struct *to = NULL; |
746 | 749 | ||
747 | /* | 750 | /* |
@@ -763,9 +766,7 @@ void mconsole_stack(struct mc_request *req) | |||
763 | return; | 766 | return; |
764 | } | 767 | } |
765 | 768 | ||
766 | from = current; | 769 | to = find_task_by_pid_ns(pid_requested, &init_pid_ns); |
767 | |||
768 | to = find_task_by_pid(pid_requested); | ||
769 | if ((to == NULL) || (pid_requested == 0)) { | 770 | if ((to == NULL) || (pid_requested == 0)) { |
770 | mconsole_reply(req, "Couldn't find that pid", 1, 0); | 771 | mconsole_reply(req, "Couldn't find that pid", 1, 0); |
771 | return; | 772 | return; |
@@ -795,6 +796,8 @@ static int __init mconsole_init(void) | |||
795 | printk(KERN_ERR "Failed to initialize management console\n"); | 796 | printk(KERN_ERR "Failed to initialize management console\n"); |
796 | return 1; | 797 | return 1; |
797 | } | 798 | } |
799 | if (os_set_fd_block(sock, 0)) | ||
800 | goto out; | ||
798 | 801 | ||
799 | register_reboot_notifier(&reboot_notifier); | 802 | register_reboot_notifier(&reboot_notifier); |
800 | 803 | ||
@@ -803,7 +806,7 @@ static int __init mconsole_init(void) | |||
803 | "mconsole", (void *)sock); | 806 | "mconsole", (void *)sock); |
804 | if (err) { | 807 | if (err) { |
805 | printk(KERN_ERR "Failed to get IRQ for management console\n"); | 808 | printk(KERN_ERR "Failed to get IRQ for management console\n"); |
806 | return 1; | 809 | goto out; |
807 | } | 810 | } |
808 | 811 | ||
809 | if (notify_socket != NULL) { | 812 | if (notify_socket != NULL) { |
@@ -819,6 +822,10 @@ static int __init mconsole_init(void) | |||
819 | printk(KERN_INFO "mconsole (version %d) initialized on %s\n", | 822 | printk(KERN_INFO "mconsole (version %d) initialized on %s\n", |
820 | MCONSOLE_VERSION, mconsole_socket_name); | 823 | MCONSOLE_VERSION, mconsole_socket_name); |
821 | return 0; | 824 | return 0; |
825 | |||
826 | out: | ||
827 | os_close_file(sock); | ||
828 | return 1; | ||
822 | } | 829 | } |
823 | 830 | ||
824 | __initcall(mconsole_init); | 831 | __initcall(mconsole_init); |
diff --git a/arch/um/drivers/mconsole_user.c b/arch/um/drivers/mconsole_user.c index 430c024a19b0..13af2f03ed84 100644 --- a/arch/um/drivers/mconsole_user.c +++ b/arch/um/drivers/mconsole_user.c | |||
@@ -83,9 +83,8 @@ int mconsole_get_request(int fd, struct mc_request *req) | |||
83 | int len; | 83 | int len; |
84 | 84 | ||
85 | req->originlen = sizeof(req->origin); | 85 | req->originlen = sizeof(req->origin); |
86 | req->len = recvfrom(fd, &req->request, sizeof(req->request), | 86 | req->len = recvfrom(fd, &req->request, sizeof(req->request), 0, |
87 | MSG_DONTWAIT, (struct sockaddr *) req->origin, | 87 | (struct sockaddr *) req->origin, &req->originlen); |
88 | &req->originlen); | ||
89 | if (req->len < 0) | 88 | if (req->len < 0) |
90 | return 0; | 89 | return 0; |
91 | 90 | ||
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c index 3c6c44ca1ffa..1e8f41a99511 100644 --- a/arch/um/drivers/net_kern.c +++ b/arch/um/drivers/net_kern.c | |||
@@ -318,7 +318,7 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name) | |||
318 | if (str == NULL) | 318 | if (str == NULL) |
319 | goto random; | 319 | goto random; |
320 | 320 | ||
321 | for (i = 0;i < 6; i++) { | 321 | for (i = 0; i < 6; i++) { |
322 | addr[i] = simple_strtoul(str, &end, 16); | 322 | addr[i] = simple_strtoul(str, &end, 16); |
323 | if ((end == str) || | 323 | if ((end == str) || |
324 | ((*end != ':') && (*end != ',') && (*end != '\0'))) { | 324 | ((*end != ':') && (*end != ',') && (*end != '\0'))) { |
@@ -343,14 +343,13 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name) | |||
343 | } | 343 | } |
344 | if (!is_local_ether_addr(addr)) { | 344 | if (!is_local_ether_addr(addr)) { |
345 | printk(KERN_WARNING | 345 | printk(KERN_WARNING |
346 | "Warning: attempt to assign a globally valid ethernet " | 346 | "Warning: Assigning a globally valid ethernet " |
347 | "address to a device\n"); | 347 | "address to a device\n"); |
348 | printk(KERN_WARNING "You should better enable the 2nd " | 348 | printk(KERN_WARNING "You should set the 2nd rightmost bit in " |
349 | "rightmost bit in the first byte of the MAC,\n"); | 349 | "the first byte of the MAC,\n"); |
350 | printk(KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n", | 350 | printk(KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n", |
351 | addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], | 351 | addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], |
352 | addr[5]); | 352 | addr[5]); |
353 | goto random; | ||
354 | } | 353 | } |
355 | return; | 354 | return; |
356 | 355 | ||
@@ -368,7 +367,6 @@ static struct platform_driver uml_net_driver = { | |||
368 | .name = DRIVER_NAME, | 367 | .name = DRIVER_NAME, |
369 | }, | 368 | }, |
370 | }; | 369 | }; |
371 | static int driver_registered; | ||
372 | 370 | ||
373 | static void net_device_release(struct device *dev) | 371 | static void net_device_release(struct device *dev) |
374 | { | 372 | { |
@@ -383,6 +381,12 @@ static void net_device_release(struct device *dev) | |||
383 | free_netdev(netdev); | 381 | free_netdev(netdev); |
384 | } | 382 | } |
385 | 383 | ||
384 | /* | ||
385 | * Ensures that platform_driver_register is called only once by | ||
386 | * eth_configure. Will be set in an initcall. | ||
387 | */ | ||
388 | static int driver_registered; | ||
389 | |||
386 | static void eth_configure(int n, void *init, char *mac, | 390 | static void eth_configure(int n, void *init, char *mac, |
387 | struct transport *transport) | 391 | struct transport *transport) |
388 | { | 392 | { |
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c index 29185cad9fff..abf2653f5517 100644 --- a/arch/um/drivers/net_user.c +++ b/arch/um/drivers/net_user.c | |||
@@ -201,7 +201,7 @@ static int change_tramp(char **argv, char *output, int output_len) | |||
201 | close(fds[1]); | 201 | close(fds[1]); |
202 | 202 | ||
203 | if (pid > 0) | 203 | if (pid > 0) |
204 | helper_wait(pid, 0, "change_tramp"); | 204 | helper_wait(pid); |
205 | return pid; | 205 | return pid; |
206 | } | 206 | } |
207 | 207 | ||
diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 330543b3129b..19930081d3d8 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "linux/completion.h" | 6 | #include "linux/completion.h" |
7 | #include "linux/interrupt.h" | 7 | #include "linux/interrupt.h" |
8 | #include "linux/list.h" | 8 | #include "linux/list.h" |
9 | #include "linux/mutex.h" | ||
9 | #include "asm/atomic.h" | 10 | #include "asm/atomic.h" |
10 | #include "init.h" | 11 | #include "init.h" |
11 | #include "irq_kern.h" | 12 | #include "irq_kern.h" |
@@ -120,7 +121,7 @@ static int port_accept(struct port_list *port) | |||
120 | return 0; | 121 | return 0; |
121 | } | 122 | } |
122 | 123 | ||
123 | static DECLARE_MUTEX(ports_sem); | 124 | static DEFINE_MUTEX(ports_mutex); |
124 | static LIST_HEAD(ports); | 125 | static LIST_HEAD(ports); |
125 | 126 | ||
126 | static void port_work_proc(struct work_struct *unused) | 127 | static void port_work_proc(struct work_struct *unused) |
@@ -161,7 +162,7 @@ void *port_data(int port_num) | |||
161 | struct port_dev *dev = NULL; | 162 | struct port_dev *dev = NULL; |
162 | int fd; | 163 | int fd; |
163 | 164 | ||
164 | down(&ports_sem); | 165 | mutex_lock(&ports_mutex); |
165 | list_for_each(ele, &ports) { | 166 | list_for_each(ele, &ports) { |
166 | port = list_entry(ele, struct port_list, list); | 167 | port = list_entry(ele, struct port_list, list); |
167 | if (port->port == port_num) | 168 | if (port->port == port_num) |
@@ -216,7 +217,7 @@ void *port_data(int port_num) | |||
216 | out_free: | 217 | out_free: |
217 | kfree(port); | 218 | kfree(port); |
218 | out: | 219 | out: |
219 | up(&ports_sem); | 220 | mutex_unlock(&ports_mutex); |
220 | return dev; | 221 | return dev; |
221 | } | 222 | } |
222 | 223 | ||
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c index e942e836f995..71f0959c1535 100644 --- a/arch/um/drivers/random.c +++ b/arch/um/drivers/random.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * This software may be used and distributed according to the terms | 5 | * This software may be used and distributed according to the terms |
6 | * of the GNU General Public License, incorporated herein by reference. | 6 | * of the GNU General Public License, incorporated herein by reference. |
7 | */ | 7 | */ |
8 | #include <linux/sched.h> | ||
8 | #include <linux/module.h> | 9 | #include <linux/module.h> |
9 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
10 | #include <linux/miscdevice.h> | 11 | #include <linux/miscdevice.h> |
diff --git a/arch/um/drivers/slip_user.c b/arch/um/drivers/slip_user.c index b8711e50da80..8b80505a3fb0 100644 --- a/arch/um/drivers/slip_user.c +++ b/arch/um/drivers/slip_user.c | |||
@@ -109,7 +109,7 @@ static int slip_tramp(char **argv, int fd) | |||
109 | read_output(fds[0], output, output_len); | 109 | read_output(fds[0], output, output_len); |
110 | printk("%s", output); | 110 | printk("%s", output); |
111 | 111 | ||
112 | err = helper_wait(pid, 0, argv[0]); | 112 | err = helper_wait(pid); |
113 | close(fds[0]); | 113 | close(fds[0]); |
114 | 114 | ||
115 | out_free: | 115 | out_free: |
diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c index 89c1be225fda..a0ada8fec72a 100644 --- a/arch/um/drivers/slirp_user.c +++ b/arch/um/drivers/slirp_user.c | |||
@@ -98,7 +98,7 @@ static void slirp_close(int fd, void *data) | |||
98 | "(%d)\n", pri->pid, errno); | 98 | "(%d)\n", pri->pid, errno); |
99 | } | 99 | } |
100 | #endif | 100 | #endif |
101 | err = helper_wait(pri->pid, 1, "slirp_close"); | 101 | err = helper_wait(pri->pid); |
102 | if (err < 0) | 102 | if (err < 0) |
103 | return; | 103 | return; |
104 | 104 | ||
diff --git a/arch/um/drivers/ssl.c b/arch/um/drivers/ssl.c index 875d60d0c6a2..f1786e64607f 100644 --- a/arch/um/drivers/ssl.c +++ b/arch/um/drivers/ssl.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include "line.h" | 15 | #include "line.h" |
16 | #include "ssl.h" | 16 | #include "ssl.h" |
17 | #include "chan_kern.h" | 17 | #include "chan_kern.h" |
18 | #include "kern_util.h" | ||
19 | #include "kern.h" | 18 | #include "kern.h" |
20 | #include "init.h" | 19 | #include "init.h" |
21 | #include "irq_user.h" | 20 | #include "irq_user.h" |
diff --git a/arch/um/drivers/stdio_console.c b/arch/um/drivers/stdio_console.c index 656036e90b19..cec0c33cdd39 100644 --- a/arch/um/drivers/stdio_console.c +++ b/arch/um/drivers/stdio_console.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include "stdio_console.h" | 22 | #include "stdio_console.h" |
23 | #include "line.h" | 23 | #include "line.h" |
24 | #include "chan_kern.h" | 24 | #include "chan_kern.h" |
25 | #include "kern_util.h" | ||
26 | #include "irq_user.h" | 25 | #include "irq_user.h" |
27 | #include "mconsole_kern.h" | 26 | #include "mconsole_kern.h" |
28 | #include "init.h" | 27 | #include "init.h" |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 99f9f9605e9c..be3a2797dac4 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -49,6 +49,7 @@ | |||
49 | #include "irq_user.h" | 49 | #include "irq_user.h" |
50 | #include "irq_kern.h" | 50 | #include "irq_kern.h" |
51 | #include "ubd_user.h" | 51 | #include "ubd_user.h" |
52 | #include "kern_util.h" | ||
52 | #include "os.h" | 53 | #include "os.h" |
53 | #include "mem.h" | 54 | #include "mem.h" |
54 | #include "mem_kern.h" | 55 | #include "mem_kern.h" |
@@ -229,7 +230,7 @@ static int proc_ide_read_media(char *page, char **start, off_t off, int count, | |||
229 | return len; | 230 | return len; |
230 | } | 231 | } |
231 | 232 | ||
232 | static void make_ide_entries(char *dev_name) | 233 | static void make_ide_entries(const char *dev_name) |
233 | { | 234 | { |
234 | struct proc_dir_entry *dir, *ent; | 235 | struct proc_dir_entry *dir, *ent; |
235 | char name[64]; | 236 | char name[64]; |
@@ -244,7 +245,7 @@ static void make_ide_entries(char *dev_name) | |||
244 | ent->data = NULL; | 245 | ent->data = NULL; |
245 | ent->read_proc = proc_ide_read_media; | 246 | ent->read_proc = proc_ide_read_media; |
246 | ent->write_proc = NULL; | 247 | ent->write_proc = NULL; |
247 | sprintf(name,"ide0/%s", dev_name); | 248 | snprintf(name, sizeof(name), "ide0/%s", dev_name); |
248 | proc_symlink(dev_name, proc_ide_root, name); | 249 | proc_symlink(dev_name, proc_ide_root, name); |
249 | } | 250 | } |
250 | 251 | ||
@@ -437,7 +438,10 @@ __uml_help(ubd_setup, | |||
437 | " machine by running 'dd' on the device. <n> must be in the range\n" | 438 | " machine by running 'dd' on the device. <n> must be in the range\n" |
438 | " 0 to 7. Appending an 'r' to the number will cause that device\n" | 439 | " 0 to 7. Appending an 'r' to the number will cause that device\n" |
439 | " to be mounted read-only. For example ubd1r=./ext_fs. Appending\n" | 440 | " to be mounted read-only. For example ubd1r=./ext_fs. Appending\n" |
440 | " an 's' will cause data to be written to disk on the host immediately.\n\n" | 441 | " an 's' will cause data to be written to disk on the host immediately.\n" |
442 | " 'c' will cause the device to be treated as being shared between multiple\n" | ||
443 | " UMLs and file locking will be turned off - this is appropriate for a\n" | ||
444 | " cluster filesystem and inappropriate at almost all other times.\n\n" | ||
441 | ); | 445 | ); |
442 | 446 | ||
443 | static int udb_setup(char *str) | 447 | static int udb_setup(char *str) |
@@ -456,20 +460,6 @@ __uml_help(udb_setup, | |||
456 | " in the boot output.\n\n" | 460 | " in the boot output.\n\n" |
457 | ); | 461 | ); |
458 | 462 | ||
459 | static int fakehd_set = 0; | ||
460 | static int fakehd(char *str) | ||
461 | { | ||
462 | printk(KERN_INFO "fakehd : Changing ubd name to \"hd\".\n"); | ||
463 | fakehd_set = 1; | ||
464 | return 1; | ||
465 | } | ||
466 | |||
467 | __setup("fakehd", fakehd); | ||
468 | __uml_help(fakehd, | ||
469 | "fakehd\n" | ||
470 | " Change the ubd device name to \"hd\".\n\n" | ||
471 | ); | ||
472 | |||
473 | static void do_ubd_request(struct request_queue * q); | 463 | static void do_ubd_request(struct request_queue * q); |
474 | 464 | ||
475 | /* Only changed by ubd_init, which is an initcall. */ | 465 | /* Only changed by ubd_init, which is an initcall. */ |
@@ -718,8 +708,10 @@ static int ubd_add(int n, char **error_out) | |||
718 | ubd_disk_register(fake_major, ubd_dev->size, n, | 708 | ubd_disk_register(fake_major, ubd_dev->size, n, |
719 | &fake_gendisk[n]); | 709 | &fake_gendisk[n]); |
720 | 710 | ||
721 | /* perhaps this should also be under the "if (fake_major)" above */ | 711 | /* |
722 | /* using the fake_disk->disk_name and also the fakehd_set name */ | 712 | * Perhaps this should also be under the "if (fake_major)" above |
713 | * using the fake_disk->disk_name | ||
714 | */ | ||
723 | if (fake_ide) | 715 | if (fake_ide) |
724 | make_ide_entries(ubd_gendisk[n]->disk_name); | 716 | make_ide_entries(ubd_gendisk[n]->disk_name); |
725 | 717 | ||
diff --git a/arch/um/drivers/ubd_user.c b/arch/um/drivers/ubd_user.c index 48fc7452bc1d..b591bb9c41dd 100644 --- a/arch/um/drivers/ubd_user.c +++ b/arch/um/drivers/ubd_user.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <sys/mman.h> | 16 | #include <sys/mman.h> |
17 | #include <sys/param.h> | 17 | #include <sys/param.h> |
18 | #include "asm/types.h" | 18 | #include "asm/types.h" |
19 | #include "kern_util.h" | ||
20 | #include "user.h" | 19 | #include "user.h" |
21 | #include "ubd_user.h" | 20 | #include "ubd_user.h" |
22 | #include "os.h" | 21 | #include "os.h" |
diff --git a/arch/um/drivers/vde_user.c b/arch/um/drivers/vde_user.c index d9941fe5f931..56533db25343 100644 --- a/arch/um/drivers/vde_user.c +++ b/arch/um/drivers/vde_user.c | |||
@@ -80,7 +80,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init) | |||
80 | 80 | ||
81 | vpri->args = kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL); | 81 | vpri->args = kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL); |
82 | if (vpri->args == NULL) { | 82 | if (vpri->args == NULL) { |
83 | printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args" | 83 | printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args " |
84 | "allocation failed"); | 84 | "allocation failed"); |
85 | return; | 85 | return; |
86 | } | 86 | } |