blk-cgroup: Allow creation of hierarchical cgroups
[linux-2.6.git] / block / blk-exec.c
index 6af716d..cf1456a 100644 (file)
@@ -51,14 +51,13 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
        int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
 
        rq->rq_disk = bd_disk;
-       rq->cmd_flags |= REQ_NOMERGE;
        rq->end_io = done;
        WARN_ON(irqs_disabled());
        spin_lock_irq(q->queue_lock);
        __elv_add_request(q, rq, where, 1);
        __generic_unplug_device(q);
        /* the queue is stopped so it won't be plugged+unplugged */
-       if (blk_pm_resume_request(rq))
+       if (rq->cmd_type == REQ_TYPE_PM_RESUME)
                q->request_fn(q);
        spin_unlock_irq(q->queue_lock);
 }
@@ -81,6 +80,7 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
        DECLARE_COMPLETION_ONSTACK(wait);
        char sense[SCSI_SENSE_BUFFERSIZE];
        int err = 0;
+       unsigned long hang_check;
 
        /*
         * we need an extra reference to the request, so we can look at
@@ -96,7 +96,13 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
 
        rq->end_io_data = &wait;
        blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
-       wait_for_completion(&wait);
+
+       /* Prevent hang_check timer from firing at us during very long I/O */
+       hang_check = sysctl_hung_task_timeout_secs;
+       if (hang_check)
+               while (!wait_for_completion_timeout(&wait, hang_check * (HZ/2)));
+       else
+               wait_for_completion(&wait);
 
        if (rq->errors)
                err = -EIO;