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

[Xen-changelog] [xen-unstable] fs-backend: fix FD allocation for file creation



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1216975746 -3600
# Node ID 526e14c2eb68c5035b3949fa1b5b8e0fe27ccbc6
# Parent  9b8f3ec6c5fde0391a3b2128d63b8c988429da80
fs-backend: fix FD allocation for file creation

The creation operation also opens a file, we need to allocate a
virtual fd for that too.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 tools/fs-back/fs-ops.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)

diff -r 9b8f3ec6c5fd -r 526e14c2eb68 tools/fs-back/fs-ops.c
--- a/tools/fs-back/fs-ops.c    Fri Jul 25 09:47:41 2008 +0100
+++ b/tools/fs-back/fs-ops.c    Fri Jul 25 09:49:06 2008 +0100
@@ -459,7 +459,17 @@ void dispatch_create(struct mount *mount
     else
     {
         printf("Issuing create for file: %s\n", full_path);
-        ret = creat(full_path, mode); 
+        ret = get_fd(mount);
+        if (ret >= 0) {
+            int real_fd = creat(full_path, mode); 
+            if (real_fd < 0)
+                ret = -1;
+            else
+            {
+                mount->fds[ret] = real_fd;
+                printf("Got FD: %d for real %d\n", ret, real_fd);
+            }
+        }
     }
     printf("Got ret %d (errno=%d)\n", ret, errno);
 

_______________________________________________
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®.