ia64/linux-2.6.18-xen.hg

changeset 597:db4f08203b8a

pvSCSI: cleanup and fix few bugs

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jul 08 09:31:24 2008 +0100 (2008-07-08)
parents 132bae41625f
children f1d726b984a3
files drivers/xen/scsiback/scsiback.c drivers/xen/scsiback/translate.c drivers/xen/scsifront/scsifront.c
line diff
     1.1 --- a/drivers/xen/scsiback/scsiback.c	Tue Jul 08 09:30:34 2008 +0100
     1.2 +++ b/drivers/xen/scsiback/scsiback.c	Tue Jul 08 09:31:24 2008 +0100
     1.3 @@ -510,7 +510,7 @@ static int prepare_pending_reqs(struct v
     1.4  		pending_req->sdev = NULL;
     1.5  		DPRINTK("scsiback: doesn't exist.\n");
     1.6  		err = -ENODEV;
     1.7 -		goto invald_value;
     1.8 +		goto invalid_value;
     1.9  	}
    1.10  	pending_req->sdev = sdev;
    1.11  
    1.12 @@ -524,7 +524,7 @@ static int prepare_pending_reqs(struct v
    1.13  		DPRINTK("scsiback: invalid parameter data_dir = %d\n",
    1.14  			pending_req->sc_data_direction);
    1.15  		err = -EINVAL;
    1.16 -		goto invald_value;
    1.17 +		goto invalid_value;
    1.18  	}
    1.19  
    1.20  	pending_req->nr_segments = ring_req->nr_segments;
    1.21 @@ -533,7 +533,7 @@ static int prepare_pending_reqs(struct v
    1.22  		DPRINTK("scsiback: invalid parameter nr_seg = %d\n",
    1.23  			pending_req->nr_segments);
    1.24  		err = -EINVAL;
    1.25 -		goto invald_value;
    1.26 +		goto invalid_value;
    1.27  	}
    1.28  
    1.29  	pending_req->cmd_len = ring_req->cmd_len;
    1.30 @@ -542,7 +542,7 @@ static int prepare_pending_reqs(struct v
    1.31  		DPRINTK("scsiback: invalid parameter cmd_len = %d\n",
    1.32  			pending_req->cmd_len);
    1.33  		err = -EINVAL;
    1.34 -		goto invald_value;
    1.35 +		goto invalid_value;
    1.36  	}
    1.37  	memcpy(pending_req->cmnd, ring_req->cmnd, pending_req->cmd_len);
    1.38  	
    1.39 @@ -551,12 +551,12 @@ static int prepare_pending_reqs(struct v
    1.40  	if(scsiback_gnttab_data_map(ring_req, pending_req)) {
    1.41  		DPRINTK("scsiback: invalid buffer\n");
    1.42  		err = -EINVAL;
    1.43 -		goto invald_value;
    1.44 +		goto invalid_value;
    1.45  	}
    1.46  
    1.47  	return 0;
    1.48  
    1.49 -invald_value:
    1.50 +invalid_value:
    1.51  	return err;
    1.52  }
    1.53  
    1.54 @@ -669,7 +669,7 @@ static int __init scsiback_init(void)
    1.55  		pending_grant_handles[i] = SCSIBACK_INVALID_HANDLE;
    1.56  
    1.57  	if (scsiback_interface_init() < 0)
    1.58 -		goto out_of_memory;
    1.59 +		goto out_of_kmem;
    1.60  
    1.61  	memset(pending_reqs, 0, sizeof(pending_reqs));
    1.62  	INIT_LIST_HEAD(&pending_free);
    1.63 @@ -678,12 +678,16 @@ static int __init scsiback_init(void)
    1.64  		list_add_tail(&pending_reqs[i].free_list, &pending_free);
    1.65  
    1.66  	if (scsiback_xenbus_init())
    1.67 -		goto out_of_memory;
    1.68 +		goto out_of_xenbus;
    1.69  
    1.70  	scsiback_emulation_init();
    1.71  
    1.72  	return 0;
    1.73  
    1.74 +out_of_xenbus:
    1.75 +	scsiback_xenbus_unregister();
    1.76 +out_of_kmem:
    1.77 +	scsiback_interface_exit();
    1.78  out_of_memory:
    1.79  	kfree(pending_reqs);
    1.80  	kfree(pending_grant_handles);
     2.1 --- a/drivers/xen/scsiback/translate.c	Tue Jul 08 09:30:34 2008 +0100
     2.2 +++ b/drivers/xen/scsiback/translate.c	Tue Jul 08 09:31:24 2008 +0100
     2.3 @@ -107,7 +107,7 @@ int scsiback_del_translation_entry(struc
     2.4  	}
     2.5  
     2.6  	spin_unlock_irqrestore(&info->v2p_lock, flags);
     2.7 -	return 0;
     2.8 +	return 1;
     2.9  
    2.10  found:
    2.11  	/* Delete the translation entry specfied */
     3.1 --- a/drivers/xen/scsifront/scsifront.c	Tue Jul 08 09:30:34 2008 +0100
     3.2 +++ b/drivers/xen/scsifront/scsifront.c	Tue Jul 08 09:31:24 2008 +0100
     3.3 @@ -146,7 +146,6 @@ static void scsifront_cdb_cmd_done(struc
     3.4  	scsifront_gnttab_done(&info->shadow[id], id);
     3.5  	add_id_to_freelist(info, id);
     3.6  
     3.7 -	rmb();
     3.8  	if (atomic_read(&info->abort_reset_cond) == VSCSI_IN_RESET) {
     3.9  		sc->result = (DID_RESET << 16);
    3.10  	} else {