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

[Xen-changelog] Remove use of get_gendisk in blkfront gen_gendisk is no long exported



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 6b62605e77b514707661c1950ce07eb62eb22b6a
# Parent  356c175366a1b65d8b2ae82653247b5ae675cf7d
Remove use of get_gendisk in blkfront gen_gendisk is no long exported
by 2.6 kernel. Now blkfront can be built as a kernel module.

Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Signed-off-by: Jeremy Katz <katzj@xxxxxxxxxx>

diff -r 356c175366a1 -r 6b62605e77b5 
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Wed Nov  9 
13:39:32 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c      Wed Nov  9 
13:41:14 2005
@@ -641,6 +641,7 @@
        info->vdevice = vdevice;
        info->connected = BLKIF_STATE_DISCONNECTED;
        info->mi = NULL;
+       info->gd = NULL;
        INIT_WORK(&info->work, blkif_restart_queue, (void *)info);
 
        info->shadow_free = 0;
diff -r 356c175366a1 -r 6b62605e77b5 
linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h Wed Nov  9 13:39:32 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/block.h Wed Nov  9 13:41:14 2005
@@ -116,6 +116,7 @@
        /* We watch the backend */
        struct xenbus_watch watch;
        dev_t dev;
+       struct gendisk *gd;
        int vdevice;
        blkif_vdev_t handle;
        int connected;
diff -r 356c175366a1 -r 6b62605e77b5 
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   Wed Nov  9 13:39:32 2005
+++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c   Wed Nov  9 13:41:14 2005
@@ -259,6 +259,7 @@
                gd->flags |= GENHD_FL_CD;
 
        add_disk(gd);
+       info->gd = gd;
 
        return 0;
 
@@ -292,22 +293,19 @@
 xlvbd_del(struct blkfront_info *info)
 {
        struct block_device *bd;
-       struct gendisk *gd;
-       int unused;
-       request_queue_t *rq;
 
        bd = bdget(info->dev);
        if (bd == NULL)
                return;
 
-       gd = get_gendisk(info->dev, &unused);
-       rq = gd->queue;
-
-       del_gendisk(gd);
-       put_disk(gd);
+       if (info->gd == NULL)
+               return;
+
+       del_gendisk(info->gd);
+       put_disk(info->gd);
        xlbd_put_major_info(info->mi);
        info->mi = NULL;
-       blk_cleanup_queue(rq);
+       blk_cleanup_queue(info->rq);
 
        bdput(bd);
 }

_______________________________________________
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®.