(struct block_device_context *)blkvsc_req->dev;
struct scsi_sense_hdr sense_hdr;
struct vmscsi_request *vm_srb;
+ unsigned long flags;
vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
+
+ spin_lock_irqsave(&blkdev->lock, flags);
blkdev->num_outstanding_reqs--;
+ spin_unlock_irqrestore(&blkdev->lock, flags);
if (vm_srb->scsi_status)
if (scsi_normalize_sense(blkvsc_req->sense_buffer,
unsigned char device_type;
struct scsi_sense_hdr sense_hdr;
struct vmscsi_request *vm_srb;
+ unsigned long flags;
int ret = 0;
goto cleanup;
}
+ spin_lock_irqsave(&blkdev->lock, flags);
blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion);
+ spin_unlock_irqrestore(&blkdev->lock, flags);
wait_for_completion_interruptible(&blkvsc_req->request.wait_event);
blk_stop_queue(blkdev->gd->queue);
+ blkvsc_cancel_pending_reqs(blkdev);
+
spin_unlock_irqrestore(&blkdev->lock, flags);
while (blkdev->num_outstanding_reqs) {
udelay(100);
}
- blkvsc_do_operation(blkdev, DO_FLUSH);
-
- spin_lock_irqsave(&blkdev->lock, flags);
- blkvsc_cancel_pending_reqs(blkdev);
-
- spin_unlock_irqrestore(&blkdev->lock, flags);
+ blkvsc_do_operation(blkdev, DO_FLUSH);
blk_cleanup_queue(blkdev->gd->queue);
blk_stop_queue(blkdev->gd->queue);
+ blkvsc_cancel_pending_reqs(blkdev);
+
spin_unlock_irqrestore(&blkdev->lock, flags);
while (blkdev->num_outstanding_reqs) {
udelay(100);
}
- blkvsc_do_operation(blkdev, DO_FLUSH);
- spin_lock_irqsave(&blkdev->lock, flags);
-
- blkvsc_cancel_pending_reqs(blkdev);
+ blkvsc_do_operation(blkdev, DO_FLUSH);
- spin_unlock_irqrestore(&blkdev->lock, flags);
}
static int blkvsc_release(struct gendisk *disk, fmode_t mode)
struct block_device_context *blkdev = disk->private_data;
unsigned long flags;
- spin_lock_irqsave(&blkdev->lock, flags);
if (blkdev->users == 1) {
- spin_unlock_irqrestore(&blkdev->lock, flags);
blkvsc_do_operation(blkdev, DO_FLUSH);
- spin_lock_irqsave(&blkdev->lock, flags);
}
+ spin_lock_irqsave(&blkdev->lock, flags);
blkdev->users--;
-
spin_unlock_irqrestore(&blkdev->lock, flags);
+
return 0;
}
struct storvsc_major_info major_info;
int ret = 0;
-
blkdev = kzalloc(sizeof(struct block_device_context), GFP_KERNEL);
if (!blkdev) {
ret = -ENOMEM;