aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/mg_disk.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c
index 826c3492b9fe..be323880f24a 100644
--- a/drivers/block/mg_disk.c
+++ b/drivers/block/mg_disk.c
@@ -672,16 +672,16 @@ static void mg_request_poll(struct request_queue *q)
672 672
673 while ((req = elv_next_request(q)) != NULL) { 673 while ((req = elv_next_request(q)) != NULL) {
674 host = req->rq_disk->private_data; 674 host = req->rq_disk->private_data;
675 if (blk_fs_request(req)) { 675
676 switch (rq_data_dir(req)) { 676 if (unlikely(!blk_fs_request(req))) {
677 case READ: 677 __blk_end_request_cur(req, -EIO);
678 mg_read(req); 678 continue;
679 break;
680 case WRITE:
681 mg_write(req);
682 break;
683 }
684 } 679 }
680
681 if (rq_data_dir(req) == READ)
682 mg_read(req);
683 else
684 mg_write(req);
685 } 685 }
686} 686}
687 687
@@ -766,8 +766,10 @@ static void mg_request(struct request_queue *q)
766 continue; 766 continue;
767 } 767 }
768 768
769 if (!blk_fs_request(req)) 769 if (unlikely(!blk_fs_request(req))) {
770 return; 770 __blk_end_request_cur(req, -EIO);
771 continue;
772 }
771 773
772 if (!mg_issue_req(req, host, sect_num, sect_cnt)) 774 if (!mg_issue_req(req, host, sect_num, sect_cnt))
773 return; 775 return;