direct-io.hg

changeset 10563:a75c1bdfe761

[LINUX] A few clean ups and a fix to an error path in xen_create/destroy_contiguous_region.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@dhcp93.uk.xensource.com
date Fri Jun 30 10:24:14 2006 +0100 (2006-06-30)
parents d095e99392ac
children 129ce4f59b6d
files linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Fri Jun 30 10:16:12 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/hypervisor.c	Fri Jun 30 10:24:14 2006 +0100
     1.3 @@ -301,7 +301,7 @@ int xen_create_contiguous_region(
     1.4  	if (xen_feature(XENFEAT_auto_translated_physmap))
     1.5  		return 0;
     1.6  
     1.7 -	if (order > MAX_CONTIG_ORDER)
     1.8 +	if (unlikely(order > MAX_CONTIG_ORDER))
     1.9  		return -ENOMEM;
    1.10  
    1.11  	set_xen_guest_handle(exchange.in.extent_start, in_frames);
    1.12 @@ -397,7 +397,7 @@ void xen_destroy_contiguous_region(unsig
    1.13  	    !test_bit(__pa(vstart) >> PAGE_SHIFT, contiguous_bitmap))
    1.14  		return;
    1.15  
    1.16 -	if (order > MAX_CONTIG_ORDER)
    1.17 +	if (unlikely(order > MAX_CONTIG_ORDER))
    1.18  		return;
    1.19  
    1.20  	set_xen_guest_handle(exchange.in.extent_start, &in_frame);
    1.21 @@ -419,7 +419,8 @@ void xen_destroy_contiguous_region(unsig
    1.22  	/* 2. Zap current PTEs. */
    1.23  	for (i = 0; i < (1UL<<order); i++) {
    1.24  		if (HYPERVISOR_update_va_mapping(vstart + (i*PAGE_SIZE),
    1.25 -						 __pte_ma(0), 0));
    1.26 +						 __pte_ma(0), 0))
    1.27 +			BUG();
    1.28  		set_phys_to_machine((__pa(vstart)>>PAGE_SHIFT)+i,
    1.29  			INVALID_P2M_ENTRY);
    1.30  		out_frames[i] = (__pa(vstart) >> PAGE_SHIFT) + i;
    1.31 @@ -430,7 +431,7 @@ void xen_destroy_contiguous_region(unsig
    1.32  	success = (exchange.nr_exchanged == 1);
    1.33  	BUG_ON(!success && ((exchange.nr_exchanged != 0) || (rc == 0)));
    1.34  	BUG_ON(success && (rc != 0));
    1.35 -	if (rc == -ENOSYS) {
    1.36 +	if (unlikely(rc == -ENOSYS)) {
    1.37  		/* Compatibility when XENMEM_exchange is unsupported. */
    1.38  		if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
    1.39  					 &exchange.in) != 1)