Staging: hv: Cleanup blkvsc_shutdown()
authorK. Y. Srinivasan <kys@microsoft.com>
Tue, 10 May 2011 14:54:10 +0000 (07:54 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 11 May 2011 20:39:01 +0000 (13:39 -0700)
Use the newly introduced function to wait for draining I/Os to
cleanup blkvsc_shutdown().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Abhishek Kane <v-abkane@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/blkvsc_drv.c

index e6a59d753922e77d72dd1b873433da8093cfbf54..0e16b71510d62cf298ce9addf3a336b0872e14bd 100644 (file)
@@ -588,15 +588,13 @@ static void blkvsc_shutdown(struct hv_device *dev)
 
        spin_unlock_irqrestore(&blkdev->lock, flags);
 
-       while (blkdev->num_outstanding_reqs) {
-               DPRINT_INFO(STORVSC, "waiting for %d requests to complete...",
-                           blkdev->num_outstanding_reqs);
-               udelay(100);
-       }
-
-
        blkvsc_do_operation(blkdev, DO_FLUSH);
 
+       /*
+        * Now wait for all outgoing I/O to be drained.
+        */
+       storvsc_wait_to_drain((struct storvsc_device *)dev->ext);
+
 }
 
 static int blkvsc_release(struct gendisk *disk, fmode_t mode)