debuggers.hg
changeset 6986:fc2eade714f9
Fix kernel users of xs_write as well.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author | cl349@firebug.cl.cam.ac.uk |
---|---|
date | Mon Sep 19 16:02:32 2005 +0000 (2005-09-19) |
parents | 2796d45c5835 |
children | 872cf6ee0594 |
files | linux-2.6-xen-sparse/arch/xen/kernel/reboot.c linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c linux-2.6-xen-sparse/include/asm-xen/xenbus.h |
line diff
1.1 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c Mon Sep 19 14:47:56 2005 +0000 1.2 +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c Mon Sep 19 16:02:32 2005 +0000 1.3 @@ -334,7 +334,7 @@ static void shutdown_handler(struct xenb 1.4 return; 1.5 } 1.6 1.7 - xenbus_write("control", "shutdown", "", O_CREAT); 1.8 + xenbus_write("control", "shutdown", ""); 1.9 1.10 err = xenbus_transaction_end(0); 1.11 if (err == -ETIMEDOUT) {
2.1 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Mon Sep 19 14:47:56 2005 +0000 2.2 +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c Mon Sep 19 16:02:32 2005 +0000 2.3 @@ -253,31 +253,19 @@ void *xenbus_read(const char *dir, const 2.4 EXPORT_SYMBOL(xenbus_read); 2.5 2.6 /* Write the value of a single file. 2.7 - * Returns -err on failure. createflags can be 0, O_CREAT, or O_CREAT|O_EXCL. 2.8 + * Returns -err on failure. 2.9 */ 2.10 -int xenbus_write(const char *dir, const char *node, 2.11 - const char *string, int createflags) 2.12 +int xenbus_write(const char *dir, const char *node, const char *string) 2.13 { 2.14 - const char *flags, *path; 2.15 - struct kvec iovec[3]; 2.16 + const char *path; 2.17 + struct kvec iovec[2]; 2.18 2.19 path = join(dir, node); 2.20 - /* Format: Flags (as string), path, data. */ 2.21 - if (createflags == 0) 2.22 - flags = XS_WRITE_NONE; 2.23 - else if (createflags == O_CREAT) 2.24 - flags = XS_WRITE_CREATE; 2.25 - else if (createflags == (O_CREAT|O_EXCL)) 2.26 - flags = XS_WRITE_CREATE_EXCL; 2.27 - else 2.28 - return -EINVAL; 2.29 2.30 iovec[0].iov_base = (void *)path; 2.31 iovec[0].iov_len = strlen(path) + 1; 2.32 - iovec[1].iov_base = (void *)flags; 2.33 - iovec[1].iov_len = strlen(flags) + 1; 2.34 - iovec[2].iov_base = (void *)string; 2.35 - iovec[2].iov_len = strlen(string); 2.36 + iovec[1].iov_base = (void *)string; 2.37 + iovec[1].iov_len = strlen(string); 2.38 2.39 return xs_error(xs_talkv(XS_WRITE, iovec, ARRAY_SIZE(iovec), NULL)); 2.40 } 2.41 @@ -357,7 +345,7 @@ int xenbus_printf(const char *dir, const 2.42 va_end(ap); 2.43 2.44 BUG_ON(ret > sizeof(printf_buffer)-1); 2.45 - return xenbus_write(dir, node, printf_buffer, O_CREAT); 2.46 + return xenbus_write(dir, node, printf_buffer); 2.47 } 2.48 EXPORT_SYMBOL(xenbus_printf); 2.49 2.50 @@ -377,7 +365,7 @@ void xenbus_dev_error(struct xenbus_devi 2.51 2.52 BUG_ON(len + ret > sizeof(printf_buffer)-1); 2.53 dev->has_error = 1; 2.54 - if (xenbus_write(dev->nodename, "error", printf_buffer, O_CREAT) != 0) 2.55 + if (xenbus_write(dev->nodename, "error", printf_buffer) != 0) 2.56 printk("xenbus: failed to write error node for %s (%s)\n", 2.57 dev->nodename, printf_buffer); 2.58 }
3.1 --- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h Mon Sep 19 14:47:56 2005 +0000 3.2 +++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h Mon Sep 19 16:02:32 2005 +0000 3.3 @@ -83,8 +83,7 @@ extern struct semaphore xenbus_lock; 3.4 3.5 char **xenbus_directory(const char *dir, const char *node, unsigned int *num); 3.6 void *xenbus_read(const char *dir, const char *node, unsigned int *len); 3.7 -int xenbus_write(const char *dir, const char *node, 3.8 - const char *string, int createflags); 3.9 +int xenbus_write(const char *dir, const char *node, const char *string); 3.10 int xenbus_mkdir(const char *dir, const char *node); 3.11 int xenbus_exists(const char *dir, const char *node); 3.12 int xenbus_rm(const char *dir, const char *node);