Commit aac7af6d authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Get rid of the state media_not_present

The block driver in Hyper-V does not handle removable media, get rid of the
media_not_present state.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 26a19739
...@@ -103,7 +103,6 @@ struct block_device_context { ...@@ -103,7 +103,6 @@ struct block_device_context {
unsigned int device_id_len; unsigned int device_id_len;
int num_outstanding_reqs; int num_outstanding_reqs;
int shutting_down; int shutting_down;
int media_not_present;
unsigned int sector_size; unsigned int sector_size;
sector_t capacity; sector_t capacity;
unsigned int port; unsigned int port;
...@@ -446,7 +445,6 @@ static int blkvsc_do_operation(struct block_device_context *blkdev, ...@@ -446,7 +445,6 @@ static int blkvsc_do_operation(struct block_device_context *blkdev,
case DO_CAPACITY: case DO_CAPACITY:
blkdev->sector_size = 0; blkdev->sector_size = 0;
blkdev->capacity = 0; blkdev->capacity = 0;
blkdev->media_not_present = 0; /* assume a disk is present */
blkvsc_req->cmnd[0] = READ_CAPACITY; blkvsc_req->cmnd[0] = READ_CAPACITY;
blkvsc_req->cmd_len = 16; blkvsc_req->cmd_len = 16;
...@@ -473,10 +471,6 @@ static int blkvsc_do_operation(struct block_device_context *blkdev, ...@@ -473,10 +471,6 @@ static int blkvsc_do_operation(struct block_device_context *blkdev,
scsi_normalize_sense(blkvsc_req->sense_buffer, scsi_normalize_sense(blkvsc_req->sense_buffer,
SCSI_SENSE_BUFFERSIZE, &sense_hdr); SCSI_SENSE_BUFFERSIZE, &sense_hdr);
if (sense_hdr.asc == 0x3A)
/* Medium not present */
blkdev->media_not_present = 1;
return 0; return 0;
} }
...@@ -964,8 +958,7 @@ static void blkvsc_request(struct request_queue *queue) ...@@ -964,8 +958,7 @@ static void blkvsc_request(struct request_queue *queue)
DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req); DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req);
blkdev = req->rq_disk->private_data; blkdev = req->rq_disk->private_data;
if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS || if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS) {
blkdev->media_not_present) {
__blk_end_request_cur(req, 0); __blk_end_request_cur(req, 0);
continue; continue;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment