WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Clean up block-device hotplug routines in xenlinux.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Clean up block-device hotplug routines in xenlinux.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Mar 2006 15:24:07 +0000
Delivery-date: Mon, 13 Mar 2006 15:25:05 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 36cf47cfea4e3c0197db6b8822398da4a3f624b3
# Parent  68915c4893ee3184ca955b90e221dd8e69772a46
Clean up block-device hotplug routines in xenlinux.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 68915c4893ee -r 36cf47cfea4e 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Mon Mar 13 
12:03:51 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Mon Mar 13 
14:06:58 2006
@@ -352,11 +352,7 @@
 
        DPRINTK("blkfront_closing: %s removed\n", dev->nodename);
 
-       if (info->mi) {
-               DPRINTK("Calling xlvbd_del\n");
-               xlvbd_del(info);
-               info->mi = NULL;
-       }
+       xlvbd_del(info);
 
        xenbus_switch_state(dev, XBT_NULL, XenbusStateClosed);
 }
diff -r 68915c4893ee -r 36cf47cfea4e 
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   Mon Mar 13 12:03:51 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   Mon Mar 13 14:06:58 2006
@@ -216,6 +216,10 @@
        int nr_minors = 1;
        int err = -ENODEV;
 
+       BUG_ON(info->gd != NULL);
+       BUG_ON(info->mi != NULL);
+       BUG_ON(info->rq != NULL);
+
        mi = xlbd_get_major_info(vdevice);
        if (mi == NULL)
                goto out;
@@ -268,6 +272,7 @@
  out:
        if (mi)
                xlbd_put_major_info(mi);
+       info->mi = NULL;
        return err;
 }
 
@@ -294,22 +299,20 @@
 void
 xlvbd_del(struct blkfront_info *info)
 {
-       struct block_device *bd;
-
-       bd = bdget(info->dev);
-       if (bd == NULL)
+       if (info->mi == NULL)
                return;
 
-       if (info->gd == NULL)
-               return;
-
+       BUG_ON(info->gd == NULL);
        del_gendisk(info->gd);
        put_disk(info->gd);
+       info->gd = NULL;
+
        xlbd_put_major_info(info->mi);
        info->mi = NULL;
+
+       BUG_ON(info->rq == NULL);
        blk_cleanup_queue(info->rq);
-
-       bdput(bd);
+       info->rq = NULL;
 }
 
 /*

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Clean up block-device hotplug routines in xenlinux., Xen patchbot -unstable <=