block: implement and enforce request peek/start/fetch
[safe/jmp/linux-2.6] / arch / arm / plat-omap / mailbox.c
index 7a1f5c2..40424ed 100644 (file)
@@ -197,9 +197,7 @@ static void mbox_tx_work(struct work_struct *work)
                struct omap_msg_tx_data *tx_data;
 
                spin_lock(q->queue_lock);
-               rq = elv_next_request(q);
-               if (rq)
-                       blkdev_dequeue_request(rq);
+               rq = blk_fetch_request(q);
                spin_unlock(q->queue_lock);
 
                if (!rq)
@@ -242,9 +240,7 @@ static void mbox_rx_work(struct work_struct *work)
 
        while (1) {
                spin_lock_irqsave(q->queue_lock, flags);
-               rq = elv_next_request(q);
-               if (rq)
-                       blkdev_dequeue_request(rq);
+               rq = blk_fetch_request(q);
                spin_unlock_irqrestore(q->queue_lock, flags);
                if (!rq)
                        break;
@@ -351,9 +347,7 @@ omap_mbox_read(struct device *dev, struct device_attribute *attr, char *buf)
 
        while (1) {
                spin_lock_irqsave(q->queue_lock, flags);
-               rq = elv_next_request(q);
-               if (rq)
-                       blkdev_dequeue_request(rq);
+               rq = blk_fetch_request(q);
                spin_unlock_irqrestore(q->queue_lock, flags);
 
                if (!rq)