]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/blk-merge.c
usb gadget: link fixes for MIDI gadget
[linux-2.6-omap-h63xx.git] / block / blk-merge.c
index d81d91419ff561be9b06afd61fd419df27e2ba77..908d3e11ac523e032f3f73a91932eb49f1a5994a 100644 (file)
@@ -387,17 +387,21 @@ static int attempt_merge(struct request_queue *q, struct request *req,
        elv_merge_requests(q, req, next);
 
        if (req->rq_disk) {
-               struct hd_struct *part
-                       = get_part(req->rq_disk, req->sector);
-               disk_round_stats(req->rq_disk);
-               req->rq_disk->in_flight--;
-               if (part) {
-                       part_round_stats(part);
-                       part->in_flight--;
-               }
+               struct hd_struct *part;
+               int cpu;
+
+               cpu = part_stat_lock();
+               part = disk_map_sector_rcu(req->rq_disk, req->sector);
+
+               part_round_stats(cpu, part);
+               part_dec_in_flight(part);
+
+               part_stat_unlock();
        }
 
        req->ioprio = ioprio_best(req->ioprio, next->ioprio);
+       if (blk_rq_cpu_valid(next))
+               req->cpu = next->cpu;
 
        __blk_put_request(q, next);
        return 1;