[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix kernel users of xs_write as well.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID fc2eade714f942f54ac235a6bf5107a6818a835f
# Parent  2796d45c58356cf8554a07dcc73038a95c6f1ecc
Fix kernel users of xs_write as well.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 2796d45c5835 -r fc2eade714f9 
linux-2.6-xen-sparse/arch/xen/kernel/reboot.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Sep 19 14:47:56 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c     Mon Sep 19 16:02:32 2005
@@ -334,7 +334,7 @@
        return;
     }
 
-    xenbus_write("control", "shutdown", "", O_CREAT);
+    xenbus_write("control", "shutdown", "");
 
     err = xenbus_transaction_end(0);
     if (err == -ETIMEDOUT) {
diff -r 2796d45c5835 -r fc2eade714f9 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Mon Sep 19 
14:47:56 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c       Mon Sep 19 
16:02:32 2005
@@ -253,31 +253,19 @@
 EXPORT_SYMBOL(xenbus_read);
 
 /* Write the value of a single file.
- * Returns -err on failure.  createflags can be 0, O_CREAT, or O_CREAT|O_EXCL.
+ * Returns -err on failure.
  */
-int xenbus_write(const char *dir, const char *node,
-                const char *string, int createflags)
-{
-       const char *flags, *path;
-       struct kvec iovec[3];
+int xenbus_write(const char *dir, const char *node, const char *string)
+{
+       const char *path;
+       struct kvec iovec[2];
 
        path = join(dir, node);
-       /* Format: Flags (as string), path, data. */
-       if (createflags == 0)
-               flags = XS_WRITE_NONE;
-       else if (createflags == O_CREAT)
-               flags = XS_WRITE_CREATE;
-       else if (createflags == (O_CREAT|O_EXCL))
-               flags = XS_WRITE_CREATE_EXCL;
-       else
-               return -EINVAL;
 
        iovec[0].iov_base = (void *)path;
        iovec[0].iov_len = strlen(path) + 1;
-       iovec[1].iov_base = (void *)flags;
-       iovec[1].iov_len = strlen(flags) + 1;
-       iovec[2].iov_base = (void *)string;
-       iovec[2].iov_len = strlen(string);
+       iovec[1].iov_base = (void *)string;
+       iovec[1].iov_len = strlen(string);
 
        return xs_error(xs_talkv(XS_WRITE, iovec, ARRAY_SIZE(iovec), NULL));
 }
@@ -357,7 +345,7 @@
        va_end(ap);
 
        BUG_ON(ret > sizeof(printf_buffer)-1);
-       return xenbus_write(dir, node, printf_buffer, O_CREAT);
+       return xenbus_write(dir, node, printf_buffer);
 }
 EXPORT_SYMBOL(xenbus_printf);
 
@@ -377,7 +365,7 @@
 
        BUG_ON(len + ret > sizeof(printf_buffer)-1);
        dev->has_error = 1;
-       if (xenbus_write(dev->nodename, "error", printf_buffer, O_CREAT) != 0)
+       if (xenbus_write(dev->nodename, "error", printf_buffer) != 0)
                printk("xenbus: failed to write error node for %s (%s)\n",
                       dev->nodename, printf_buffer);
 }
diff -r 2796d45c5835 -r fc2eade714f9 
linux-2.6-xen-sparse/include/asm-xen/xenbus.h
--- a/linux-2.6-xen-sparse/include/asm-xen/xenbus.h     Mon Sep 19 14:47:56 2005
+++ b/linux-2.6-xen-sparse/include/asm-xen/xenbus.h     Mon Sep 19 16:02:32 2005
@@ -83,8 +83,7 @@
 
 char **xenbus_directory(const char *dir, const char *node, unsigned int *num);
 void *xenbus_read(const char *dir, const char *node, unsigned int *len);
-int xenbus_write(const char *dir, const char *node,
-                const char *string, int createflags);
+int xenbus_write(const char *dir, const char *node, const char *string);
 int xenbus_mkdir(const char *dir, const char *node);
 int xenbus_exists(const char *dir, const char *node);
 int xenbus_rm(const char *dir, const char *node);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.