WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] fs-backend: fix FD allocation for file creation
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 25 Jul 2008 10:00:12 -0700
Delivery-date: Fri, 25 Jul 2008 10:00:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] fs-backend: fix FD allocation for file creation, Xen patchbot-unstable <=