ia64/xen-unstable
changeset 4433:8c365db41887
bitkeeper revision 1.1236.1.192 (424d7fc8NKHAtqM1BwOleYYeAIj6uw)
Remove more bogus uses of bd_sem, and unnecessary blkif_check and
blkif_revalidate functions from Linux 2.6.
Signed-off-by: Keir Fraser <keir@xensource.com>
Remove more bogus uses of bd_sem, and unnecessary blkif_check and
blkif_revalidate functions from Linux 2.6.
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Fri Apr 01 17:07:20 2005 +0000 (2005-04-01) |
parents | 7535a4b0ae76 |
children | 185169ecc5e0 |
files | linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c |
line diff
1.1 --- a/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c Fri Apr 01 16:50:40 2005 +0000 1.2 +++ b/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c Fri Apr 01 17:07:20 2005 +0000 1.3 @@ -114,12 +114,6 @@ static int xlvbd_init_device(vdisk_t *xd 1.4 if ( (bd = bdget(device)) == NULL ) 1.5 return -1; 1.6 1.7 - /* 1.8 - * Update of partition info, and check of usage count, is protected 1.9 - * by the per-block-device semaphore. 1.10 - */ 1.11 - down(&bd->bd_sem); 1.12 - 1.13 if ( ((disk = xldev_to_xldisk(device)) != NULL) && (disk->usage != 0) ) 1.14 { 1.15 printk(KERN_ALERT "VBD update failed - in use [dev=%x]\n", device); 1.16 @@ -331,7 +325,6 @@ static int xlvbd_init_device(vdisk_t *xd 1.17 } 1.18 1.19 out: 1.20 - up(&bd->bd_sem); 1.21 bdput(bd); 1.22 return rc; 1.23 } 1.24 @@ -356,12 +349,6 @@ static int xlvbd_remove_device(int devic 1.25 if ( (bd = bdget(device)) == NULL ) 1.26 return -1; 1.27 1.28 - /* 1.29 - * Update of partition info, and check of usage count, is protected 1.30 - * by the per-block-device semaphore. 1.31 - */ 1.32 - down(&bd->bd_sem); 1.33 - 1.34 if ( ((gd = get_gendisk(device)) == NULL) || 1.35 ((disk = xldev_to_xldisk(device)) == NULL) ) 1.36 BUG(); 1.37 @@ -423,7 +410,6 @@ static int xlvbd_remove_device(int devic 1.38 } 1.39 1.40 out: 1.41 - up(&bd->bd_sem); 1.42 bdput(bd); 1.43 return rc; 1.44 }
2.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c Fri Apr 01 16:50:40 2005 +0000 2.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c Fri Apr 01 17:07:20 2005 +0000 2.3 @@ -252,65 +252,6 @@ int blkif_ioctl(struct inode *inode, str 2.4 return 0; 2.5 } 2.6 2.7 -#if 0 2.8 -/* check media change: should probably do something here in some cases :-) */ 2.9 -int blkif_check(kdev_t dev) 2.10 -{ 2.11 - DPRINTK("blkif_check\n"); 2.12 - return 0; 2.13 -} 2.14 - 2.15 -int blkif_revalidate(kdev_t dev) 2.16 -{ 2.17 - struct block_device *bd; 2.18 - struct gendisk *gd; 2.19 - xen_block_t *disk; 2.20 - unsigned long capacity; 2.21 - int i, rc = 0; 2.22 - 2.23 - if ( (bd = bdget(dev)) == NULL ) 2.24 - return -EINVAL; 2.25 - 2.26 - /* 2.27 - * Update of partition info, and check of usage count, is protected 2.28 - * by the per-block-device semaphore. 2.29 - */ 2.30 - down(&bd->bd_sem); 2.31 - 2.32 - if ( ((gd = get_gendisk(dev)) == NULL) || 2.33 - ((disk = xldev_to_xldisk(dev)) == NULL) || 2.34 - ((capacity = gd->part[MINOR(dev)].nr_sects) == 0) ) 2.35 - { 2.36 - rc = -EINVAL; 2.37 - goto out; 2.38 - } 2.39 - 2.40 - if ( disk->usage > 1 ) 2.41 - { 2.42 - rc = -EBUSY; 2.43 - goto out; 2.44 - } 2.45 - 2.46 - /* Only reread partition table if VBDs aren't mapped to partitions. */ 2.47 - if ( !(gd->flags[MINOR(dev) >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS) ) 2.48 - { 2.49 - for ( i = gd->max_p - 1; i >= 0; i-- ) 2.50 - { 2.51 - invalidate_device(dev+i, 1); 2.52 - gd->part[MINOR(dev+i)].start_sect = 0; 2.53 - gd->part[MINOR(dev+i)].nr_sects = 0; 2.54 - gd->sizes[MINOR(dev+i)] = 0; 2.55 - } 2.56 - 2.57 - grok_partitions(gd, MINOR(dev)>>gd->minor_shift, gd->max_p, capacity); 2.58 - } 2.59 - 2.60 - out: 2.61 - up(&bd->bd_sem); 2.62 - bdput(bd); 2.63 - return rc; 2.64 -} 2.65 -#endif 2.66 2.67 /* 2.68 * blkif_queue_request