diff options
Diffstat (limited to 'trunk/2.6.21/20960_linux-2.6-xen-blkfront-wait-add.patch')
-rw-r--r-- | trunk/2.6.21/20960_linux-2.6-xen-blkfront-wait-add.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/trunk/2.6.21/20960_linux-2.6-xen-blkfront-wait-add.patch b/trunk/2.6.21/20960_linux-2.6-xen-blkfront-wait-add.patch new file mode 100644 index 0000000..d372df7 --- /dev/null +++ b/trunk/2.6.21/20960_linux-2.6-xen-blkfront-wait-add.patch @@ -0,0 +1,82 @@ +Index: patching/drivers/xen/blkfront/blkfront.c +=================================================================== +--- patching.orig/drivers/xen/blkfront/blkfront.c ++++ patching/drivers/xen/blkfront/blkfront.c +@@ -354,6 +354,8 @@ static void connect(struct blkfront_info + spin_unlock_irq(&blkif_io_lock); + + add_disk(info->gd); ++ ++ info->is_ready = 1; + } + + /** +@@ -863,6 +865,13 @@ static void blkif_recover(struct blkfron + spin_unlock_irq(&blkif_io_lock); + } + ++int blkfront_is_ready(struct xenbus_device *dev) ++{ ++ struct blkfront_info *info = dev->dev.driver_data; ++ ++ return info->is_ready; ++} ++ + + /* ** Driver Registration ** */ + +@@ -881,6 +890,7 @@ static struct xenbus_driver blkfront = { + .remove = blkfront_remove, + .resume = blkfront_resume, + .otherend_changed = backend_changed, ++ .is_ready = blkfront_is_ready, + }; + + +Index: patching/drivers/xen/blkfront/block.h +=================================================================== +--- patching.orig/drivers/xen/blkfront/block.h ++++ patching/drivers/xen/blkfront/block.h +@@ -111,6 +111,7 @@ struct blkfront_info + struct blk_shadow shadow[BLK_RING_SIZE]; + unsigned long shadow_free; + int feature_barrier; ++ int is_ready; + + /** + * The number of people holding this device open. We won't allow a +Index: patching/drivers/xen/xenbus/xenbus_probe.c +=================================================================== +--- patching.orig/drivers/xen/xenbus/xenbus_probe.c ++++ patching/drivers/xen/xenbus/xenbus_probe.c +@@ -995,6 +995,7 @@ static int is_disconnected_device(struct + { + struct xenbus_device *xendev = to_xenbus_device(dev); + struct device_driver *drv = data; ++ struct xenbus_driver *xendrv; + + /* + * A device with no driver will never connect. We care only about +@@ -1007,7 +1008,9 @@ static int is_disconnected_device(struct + if (drv && (dev->driver != drv)) + return 0; + +- return (xendev->state != XenbusStateConnected); ++ xendrv = to_xenbus_driver(dev->driver); ++ return (xendev->state != XenbusStateConnected || ++ (xendrv->is_ready && !xendrv->is_ready(xendev))); + } + + static int exists_disconnected_device(struct device_driver *drv) +Index: patching/include/xen/xenbus.h +=================================================================== +--- patching.orig/include/xen/xenbus.h ++++ patching/include/xen/xenbus.h +@@ -106,6 +106,7 @@ struct xenbus_driver { + int (*uevent)(struct xenbus_device *, char **, int, char *, int); + struct device_driver driver; + int (*read_otherend_details)(struct xenbus_device *dev); ++ int (*is_ready)(struct xenbus_device *dev); + }; + + static inline struct xenbus_driver *to_xenbus_driver(struct device_driver *drv) |