]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/blk-softirq.c
fat: split include/msdos_fs.h
[linux-2.6-omap-h63xx.git] / block / blk-softirq.c
index 3a1af551191e0986e3f5b1462d7cdb0c01b21a5d..e660d26ca656f060ca0c5a61952681c7b7d55e66 100644 (file)
@@ -101,18 +101,7 @@ static struct notifier_block __cpuinitdata blk_cpu_notifier = {
        .notifier_call  = blk_cpu_notify,
 };
 
-/**
- * blk_complete_request - end I/O on a request
- * @req:      the request being processed
- *
- * Description:
- *     Ends all I/O on a request. It does not handle partial completions,
- *     unless the driver actually implements this in its completion callback
- *     through requeueing. The actual completion happens out-of-order,
- *     through a softirq handler. The user must have registered a completion
- *     callback through blk_queue_softirq_done().
- **/
-void blk_complete_request(struct request *req)
+void __blk_complete_request(struct request *req)
 {
        struct request_queue *q = req->q;
        unsigned long flags;
@@ -151,6 +140,25 @@ do_local:
 
        local_irq_restore(flags);
 }
+
+/**
+ * blk_complete_request - end I/O on a request
+ * @req:      the request being processed
+ *
+ * Description:
+ *     Ends all I/O on a request. It does not handle partial completions,
+ *     unless the driver actually implements this in its completion callback
+ *     through requeueing. The actual completion happens out-of-order,
+ *     through a softirq handler. The user must have registered a completion
+ *     callback through blk_queue_softirq_done().
+ **/
+void blk_complete_request(struct request *req)
+{
+       if (unlikely(blk_should_fake_timeout(req->q)))
+               return;
+       if (!blk_mark_rq_complete(req))
+               __blk_complete_request(req);
+}
 EXPORT_SYMBOL(blk_complete_request);
 
 __init int blk_softirq_init(void)