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] [linux-2.6.18-xen] [gntdev] Fix multiple-grant mapping l

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] [gntdev] Fix multiple-grant mapping logic
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Jan 2008 03:00:10 -0800
Delivery-date: Mon, 28 Jan 2008 03:00:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 1201516198 0
# Node ID 6157dbf408cf9c50a658eb9fdacfc78ca72bd06a
# Parent  947e0701cf7aecce9e1b391f5dadbb5024e48e12
[gntdev] Fix multiple-grant mapping logic
Signed-off-by: Derek Murray <Derek.Murray@xxxxxxxxxxxx>
---
 drivers/xen/gntdev/gntdev.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff -r 947e0701cf7a -r 6157dbf408cf drivers/xen/gntdev/gntdev.c
--- a/drivers/xen/gntdev/gntdev.c       Tue Jan 22 21:52:44 2008 +0000
+++ b/drivers/xen/gntdev/gntdev.c       Mon Jan 28 10:29:58 2008 +0000
@@ -215,6 +215,8 @@ static int add_grant_reference(struct fi
        }
 
        slot_index = private_data->free_list[--private_data->free_list_size];
+       private_data->free_list[private_data->free_list_size]
+               = GNTDEV_FREE_LIST_INVALID;
 
        /* Copy the grant information into file's private data. */
        private_data->grants[slot_index].state = GNTDEV_SLOT_NOT_YET_MAPPED;
@@ -271,13 +273,19 @@ static void compress_free_list(struct fi
 {
        gntdev_file_private_data_t *private_data 
                = (gntdev_file_private_data_t *) flip->private_data;
-       int i, j = 0, old_size;
+       int i, j = 0, old_size, slot_index;
        
        old_size = private_data->free_list_size;
        for (i = 0; i < old_size; ++i) {
                if (private_data->free_list[i] != GNTDEV_FREE_LIST_INVALID) {
-                       private_data->free_list[j] = 
-                               private_data->free_list[i];
+                       if (i > j) {
+                               slot_index = private_data->free_list[i];
+                               private_data->free_list[j] = slot_index;
+                               private_data->grants[slot_index].u
+                                       .free_list_index = j;
+                               private_data->free_list[i] 
+                                       = GNTDEV_FREE_LIST_INVALID;
+                       }
                        ++j;
                } else {
                        --private_data->free_list_size;
@@ -908,7 +916,6 @@ static long gntdev_ioctl(struct file *fl
                                start_index + i;
                        ++private_data->free_list_size;
                }
-               compress_free_list(flip);
 
        unmap_out:
                up_write(&private_data->grants_sem);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] [gntdev] Fix multiple-grant mapping logic, Xen patchbot-linux-2.6.18-xen <=