[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Remove more bogus uses of bd_sem, and unnecessary blkif_check and



ChangeSet 1.1428, 2005/04/01 18:07:20+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        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@xxxxxxxxxxxxx>



 linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c |   14 --
 linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c       |   59 ----------
 2 files changed, 73 deletions(-)


diff -Nru a/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c 
b/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c
--- a/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c     
2005-04-01 13:03:31 -05:00
+++ b/linux-2.4.29-xen-sparse/arch/xen/drivers/blkif/frontend/vbd.c     
2005-04-01 13:03:31 -05:00
@@ -114,12 +114,6 @@
     if ( (bd = bdget(device)) == NULL )
         return -1;
 
-    /*
-     * Update of partition info, and check of usage count, is protected
-     * by the per-block-device semaphore.
-     */
-    down(&bd->bd_sem);
-
     if ( ((disk = xldev_to_xldisk(device)) != NULL) && (disk->usage != 0) )
     {
         printk(KERN_ALERT "VBD update failed - in use [dev=%x]\n", device);
@@ -331,7 +325,6 @@
     }
 
  out:
-    up(&bd->bd_sem);
     bdput(bd);    
     return rc;
 }
@@ -356,12 +349,6 @@
     if ( (bd = bdget(device)) == NULL )
         return -1;
 
-    /*
-     * Update of partition info, and check of usage count, is protected
-     * by the per-block-device semaphore.
-     */
-    down(&bd->bd_sem);
-
     if ( ((gd = get_gendisk(device)) == NULL) ||
          ((disk = xldev_to_xldisk(device)) == NULL) )
         BUG();
@@ -423,7 +410,6 @@
     }
 
  out:
-    up(&bd->bd_sem);
     bdput(bd);
     return rc;
 }
diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c 
b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c   2005-04-01 
13:03:31 -05:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/blkfront.c   2005-04-01 
13:03:31 -05:00
@@ -252,65 +252,6 @@
     return 0;
 }
 
-#if 0
-/* check media change: should probably do something here in some cases :-) */
-int blkif_check(kdev_t dev)
-{
-    DPRINTK("blkif_check\n");
-    return 0;
-}
-
-int blkif_revalidate(kdev_t dev)
-{
-    struct block_device *bd;
-    struct gendisk *gd;
-    xen_block_t *disk;
-    unsigned long capacity;
-    int i, rc = 0;
-    
-    if ( (bd = bdget(dev)) == NULL )
-        return -EINVAL;
-
-    /*
-     * Update of partition info, and check of usage count, is protected
-     * by the per-block-device semaphore.
-     */
-    down(&bd->bd_sem);
-
-    if ( ((gd = get_gendisk(dev)) == NULL) ||
-         ((disk = xldev_to_xldisk(dev)) == NULL) ||
-         ((capacity = gd->part[MINOR(dev)].nr_sects) == 0) )
-    {
-        rc = -EINVAL;
-        goto out;
-    }
-
-    if ( disk->usage > 1 )
-    {
-        rc = -EBUSY;
-        goto out;
-    }
-
-    /* Only reread partition table if VBDs aren't mapped to partitions. */
-    if ( !(gd->flags[MINOR(dev) >> gd->minor_shift] & GENHD_FL_VIRT_PARTNS) )
-    {
-        for ( i = gd->max_p - 1; i >= 0; i-- )
-        {
-            invalidate_device(dev+i, 1);
-            gd->part[MINOR(dev+i)].start_sect = 0;
-            gd->part[MINOR(dev+i)].nr_sects   = 0;
-            gd->sizes[MINOR(dev+i)]           = 0;
-        }
-
-        grok_partitions(gd, MINOR(dev)>>gd->minor_shift, gd->max_p, capacity);
-    }
-
- out:
-    up(&bd->bd_sem);
-    bdput(bd);
-    return rc;
-}
-#endif
 
 /*
  * blkif_queue_request

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.