ia64/xen-unstable

changeset 7651:19e5385bc5b3

fast_flush_area() should index the unmap request array using
invcount, not i. Also, fix initialisation of pending_grant_handles:
it was happening too late, and the use of memset() was bogus.

Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Nov 07 12:52:49 2005 +0100 (2005-11-07)
parents 1f57d567cf4b
children a4bd444c5424
files linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Mon Nov 07 12:05:15 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c	Mon Nov 07 12:52:49 2005 +0100
     1.3 @@ -114,10 +114,10 @@ static void fast_flush_area(int idx, int
     1.4  		handle = pending_handle(idx, i);
     1.5  		if (handle == BLKBACK_INVALID_HANDLE)
     1.6  			continue;
     1.7 -		unmap[i].host_addr      = MMAP_VADDR(idx, i);
     1.8 -		unmap[i].dev_bus_addr   = 0;
     1.9 -		unmap[i].handle         = handle;
    1.10 -		pending_handle(idx, i)  = BLKBACK_INVALID_HANDLE;
    1.11 +		unmap[invcount].host_addr    = MMAP_VADDR(idx, i);
    1.12 +		unmap[invcount].dev_bus_addr = 0;
    1.13 +		unmap[invcount].handle       = handle;
    1.14 +		pending_handle(idx, i) = BLKBACK_INVALID_HANDLE;
    1.15  		invcount++;
    1.16  	}
    1.17  
    1.18 @@ -498,6 +498,9 @@ static int __init blkif_init(void)
    1.19  	struct page *page;
    1.20  	int ret;
    1.21  
    1.22 +	for (i = 0; i < MMAP_PAGES; i++)
    1.23 +		pending_grant_handles[i] = BLKBACK_INVALID_HANDLE;
    1.24 +
    1.25  	blkif_interface_init();
    1.26  
    1.27  	page = balloon_alloc_empty_page_range(MMAP_PAGES);
    1.28 @@ -518,8 +521,6 @@ static int __init blkif_init(void)
    1.29  
    1.30  	blkif_xenbus_init();
    1.31  
    1.32 -	memset(pending_grant_handles,  BLKBACK_INVALID_HANDLE, MMAP_PAGES);
    1.33 -
    1.34  	return 0;
    1.35  }
    1.36