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

Staging: hv: Get rid of the forward declaration for blkvsc_request()

Get rid of the forward declaration for blkvsc_request() by moving the code
around.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarAbhishek Kane <v-abkane@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 76abfaa3
...@@ -1162,9 +1162,51 @@ static int blkvsc_do_pending_reqs(struct block_device_context *blkdev) ...@@ -1162,9 +1162,51 @@ static int blkvsc_do_pending_reqs(struct block_device_context *blkdev)
return ret; return ret;
} }
static void blkvsc_request(struct request_queue *queue)
{
struct block_device_context *blkdev = NULL;
struct request *req;
int ret = 0;
DPRINT_DBG(BLKVSC_DRV, "- enter\n");
while ((req = blk_peek_request(queue)) != NULL) {
DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req);
blkdev = req->rq_disk->private_data;
if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS ||
blkdev->media_not_present) {
__blk_end_request_cur(req, 0);
continue;
}
ret = blkvsc_do_pending_reqs(blkdev);
if (ret != 0) {
DPRINT_DBG(BLKVSC_DRV,
"- stop queue - pending_list not empty\n");
blk_stop_queue(queue);
break;
}
blk_start_request(req);
ret = blkvsc_do_request(blkdev, req);
if (ret > 0) {
DPRINT_DBG(BLKVSC_DRV, "- stop queue - no room\n");
blk_stop_queue(queue);
break;
} else if (ret < 0) {
DPRINT_DBG(BLKVSC_DRV, "- stop queue - no mem\n");
blk_requeue_request(queue, req);
blk_stop_queue(queue);
break;
}
}
}
/* Static decl */ /* Static decl */
static int blkvsc_probe(struct device *dev); static int blkvsc_probe(struct device *dev);
static void blkvsc_request(struct request_queue *queue);
static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE; static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE;
module_param(blkvsc_ringbuffer_size, int, S_IRUGO); module_param(blkvsc_ringbuffer_size, int, S_IRUGO);
...@@ -1491,48 +1533,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request) ...@@ -1491,48 +1533,6 @@ static void blkvsc_request_completion(struct hv_storvsc_request *request)
spin_unlock_irqrestore(&blkdev->lock, flags); spin_unlock_irqrestore(&blkdev->lock, flags);
} }
static void blkvsc_request(struct request_queue *queue)
{
struct block_device_context *blkdev = NULL;
struct request *req;
int ret = 0;
DPRINT_DBG(BLKVSC_DRV, "- enter\n");
while ((req = blk_peek_request(queue)) != NULL) {
DPRINT_DBG(BLKVSC_DRV, "- req %p\n", req);
blkdev = req->rq_disk->private_data;
if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS ||
blkdev->media_not_present) {
__blk_end_request_cur(req, 0);
continue;
}
ret = blkvsc_do_pending_reqs(blkdev);
if (ret != 0) {
DPRINT_DBG(BLKVSC_DRV,
"- stop queue - pending_list not empty\n");
blk_stop_queue(queue);
break;
}
blk_start_request(req);
ret = blkvsc_do_request(blkdev, req);
if (ret > 0) {
DPRINT_DBG(BLKVSC_DRV, "- stop queue - no room\n");
blk_stop_queue(queue);
break;
} else if (ret < 0) {
DPRINT_DBG(BLKVSC_DRV, "- stop queue - no mem\n");
blk_requeue_request(queue, req);
blk_stop_queue(queue);
break;
}
}
}
static int __init blkvsc_init(void) static int __init blkvsc_init(void)
{ {
int ret; int ret;
......
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