aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdrom
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom')
-rw-r--r--drivers/cdrom/gdrom.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/cdrom/gdrom.c b/drivers/cdrom/gdrom.c
index 488423cab51a..3cc02bfe828d 100644
--- a/drivers/cdrom/gdrom.c
+++ b/drivers/cdrom/gdrom.c
@@ -638,33 +638,31 @@ static void gdrom_readdisk_dma(struct work_struct *work)
638 kfree(read_command); 638 kfree(read_command);
639} 639}
640 640
641static void gdrom_request_handler_dma(struct request *req)
642{
643 /* dequeue, add to list of deferred work
644 * and then schedule workqueue */
645 blkdev_dequeue_request(req);
646 list_add_tail(&req->queuelist, &gdrom_deferred);
647 schedule_work(&work);
648}
649
650static void gdrom_request(struct request_queue *rq) 641static void gdrom_request(struct request_queue *rq)
651{ 642{
652 struct request *req; 643 struct request *req;
653 644
654 while ((req = elv_next_request(rq)) != NULL) { 645 while ((req = elv_next_request(rq)) != NULL) {
646 blkdev_dequeue_request(req);
647
655 if (!blk_fs_request(req)) { 648 if (!blk_fs_request(req)) {
656 printk(KERN_DEBUG "GDROM: Non-fs request ignored\n"); 649 printk(KERN_DEBUG "GDROM: Non-fs request ignored\n");
657 __blk_end_request_cur(req, -EIO); 650 __blk_end_request_all(req, -EIO);
651 continue;
658 } 652 }
659 if (rq_data_dir(req) != READ) { 653 if (rq_data_dir(req) != READ) {
660 printk(KERN_NOTICE "GDROM: Read only device -"); 654 printk(KERN_NOTICE "GDROM: Read only device -");
661 printk(" write request ignored\n"); 655 printk(" write request ignored\n");
662 __blk_end_request_cur(req, -EIO); 656 __blk_end_request_all(req, -EIO);
657 continue;
663 } 658 }
664 if (blk_rq_sectors(req)) 659
665 gdrom_request_handler_dma(req); 660 /*
666 else 661 * Add to list of deferred work and then schedule
667 __blk_end_request_cur(req, -EIO); 662 * workqueue.
663 */
664 list_add_tail(&req->queuelist, &gdrom_deferred);
665 schedule_work(&work);
668 } 666 }
669} 667}
670 668