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 freelist implementation

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] fs-backend: Fix freelist implementation
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jul 2008 17:40:11 -0700
Delivery-date: Tue, 15 Jul 2008 17:40:08 -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 1216141171 -3600
# Node ID 5f529c74a71250cdffd7cd97cb21f14691c00f69
# Parent  b38bceff087af4573dfaf5bb6dad7ac1cfa36148
fs-backend: Fix freelist implementation

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 tools/fs-back/fs-backend.c |    4 ++--
 tools/fs-back/fs-backend.h |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -r b38bceff087a -r 5f529c74a712 tools/fs-back/fs-backend.c
--- a/tools/fs-back/fs-backend.c        Tue Jul 15 17:58:39 2008 +0100
+++ b/tools/fs-back/fs-backend.c        Tue Jul 15 17:59:31 2008 +0100
@@ -110,9 +110,9 @@ void allocate_request_array(struct mount
     unsigned short *freelist;
     
     requests = malloc(sizeof(struct fs_request) *nr_entries);
-    freelist = malloc(sizeof(unsigned short) * nr_entries); 
+    freelist = malloc(sizeof(unsigned short) * (nr_entries + 1)); 
     memset(requests, 0, sizeof(struct fs_request) * nr_entries);
-    memset(freelist, 0, sizeof(unsigned short) * nr_entries);
+    memset(freelist, 0, sizeof(unsigned short) * (nr_entries + 1));
     for(i=0; i< nr_entries; i++)
     {
         requests[i].active = 0; 
diff -r b38bceff087a -r 5f529c74a712 tools/fs-back/fs-backend.h
--- a/tools/fs-back/fs-backend.h        Tue Jul 15 17:58:39 2008 +0100
+++ b/tools/fs-back/fs-backend.h        Tue Jul 15 17:59:31 2008 +0100
@@ -72,14 +72,14 @@ extern struct fs_op *fsops[];
 
 static inline void add_id_to_freelist(unsigned int id,unsigned short* freelist)
 {
-    freelist[id] = freelist[0];
+    freelist[id + 1] = freelist[0];
     freelist[0]  = id;
 }
 
 static inline unsigned short get_id_from_freelist(unsigned short* freelist)
 {
     unsigned int id = freelist[0];
-    freelist[0] = freelist[id];
+    freelist[0] = freelist[id + 1];
     return id;
 }
 

_______________________________________________
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 freelist implementation, Xen patchbot-unstable <=