X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fxen%2Fblkfront%2Fblkfront.c;h=a911c766a70a61d7992edd1e33955d02582b6d31;hb=9464c7cf61b9433057924c36e6e02f303a00e768;hp=2b1620006071b0125ced221c377f9feaedaad57a;hpb=41689045f6a3cbe0550e1d34e9cc20d2e8c432ba;p=linux-2.6.git diff --git a/drivers/xen/blkfront/blkfront.c b/drivers/xen/blkfront/blkfront.c index 2b1620006..a911c766a 100644 --- a/drivers/xen/blkfront/blkfront.c +++ b/drivers/xen/blkfront/blkfront.c @@ -46,7 +46,6 @@ #include #include #include -#include #define BLKIF_STATE_DISCONNECTED 0 #define BLKIF_STATE_CONNECTED 1 @@ -256,10 +255,10 @@ static void backend_changed(struct xenbus_device *dev, DPRINTK("blkfront:backend_changed.\n"); switch (backend_state) { + case XenbusStateUnknown: case XenbusStateInitialising: case XenbusStateInitWait: case XenbusStateInitialised: - case XenbusStateUnknown: case XenbusStateClosed: break; @@ -355,14 +354,12 @@ static void blkfront_closing(struct xenbus_device *dev) blk_stop_queue(info->rq); /* No more gnttab callback work. */ gnttab_cancel_free_callback(&info->callback); - spin_unlock_irqrestore(&blkif_io_lock, flags); - - /* Flush gnttab callback work. Must be done with no locks held. */ flush_scheduled_work(); + spin_unlock_irqrestore(&blkif_io_lock, flags); xlvbd_del(info); - xenbus_frontend_closed(dev); + xenbus_switch_state(dev, XenbusStateClosed); } @@ -716,10 +713,8 @@ static void blkif_free(struct blkfront_info *info, int suspend) blk_stop_queue(info->rq); /* No more gnttab callback work. */ gnttab_cancel_free_callback(&info->callback); - spin_unlock_irq(&blkif_io_lock); - - /* Flush gnttab callback work. Must be done with no locks held. */ flush_scheduled_work(); + spin_unlock_irq(&blkif_io_lock); /* Free resources associated with old device channel. */ if (info->ring_ref != GRANT_INVALID_REF) {