]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Oct 2010 14:45:10 +0000 (07:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 25 Oct 2010 14:45:10 +0000 (07:45 -0700)
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  Revert "block: fix accounting bug on cross partition merges"

1  2 
block/blk-core.c

diff --combined block/blk-core.c
index 881fe44ec7da3c8356a3fca07f3905cd8befc0f2,f8548876d7ea03b04c778ae6b71e9363b2186d73..f0834e2f57275d8903f65b655645f66a9b2016ee
@@@ -64,15 -64,13 +64,13 @@@ static void drive_stat_acct(struct requ
                return;
  
        cpu = part_stat_lock();
+       part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));
  
-       if (!new_io) {
-               part = rq->part;
+       if (!new_io)
                part_stat_inc(cpu, part, merges[rw]);
-       } else {
-               part = disk_map_sector_rcu(rq->rq_disk, blk_rq_pos(rq));
+       else {
                part_round_stats(cpu, part);
                part_inc_in_flight(part, rw);
-               rq->part = part;
        }
  
        part_stat_unlock();
@@@ -130,7 -128,6 +128,6 @@@ void blk_rq_init(struct request_queue *
        rq->ref_count = 1;
        rq->start_time = jiffies;
        set_start_time_ns(rq);
-       rq->part = NULL;
  }
  EXPORT_SYMBOL(blk_rq_init);
  
@@@ -805,16 -802,11 +802,11 @@@ static struct request *get_request(stru
        rl->starved[is_sync] = 0;
  
        priv = !test_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);
-       if (priv) {
+       if (priv)
                rl->elvpriv++;
  
-               /*
-                * Don't do stats for non-priv requests
-                */
-               if (blk_queue_io_stat(q))
-                       rw_flags |= REQ_IO_STAT;
-       }
+       if (blk_queue_io_stat(q))
+               rw_flags |= REQ_IO_STAT;
        spin_unlock_irq(q->queue_lock);
  
        rq = blk_alloc_request(q, rw_flags, priv, gfp_mask);
@@@ -1669,7 -1661,7 +1661,7 @@@ EXPORT_SYMBOL(submit_bio)
   *    the insertion using this generic function.
   *
   *    This function should also be useful for request stacking drivers
 - *    in some cases below, so export this fuction.
 + *    in some cases below, so export this function.
   *    Request stacking drivers like request-based dm may change the queue
   *    limits while requests are in the queue (e.g. dm's table swapping).
   *    Such request stacking drivers should check those requests agaist
@@@ -1791,7 -1783,7 +1783,7 @@@ static void blk_account_io_completion(s
                int cpu;
  
                cpu = part_stat_lock();
-               part = req->part;
+               part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
                part_stat_add(cpu, part, sectors[rw], bytes >> 9);
                part_stat_unlock();
        }
@@@ -1811,7 -1803,7 +1803,7 @@@ static void blk_account_io_done(struct 
                int cpu;
  
                cpu = part_stat_lock();
-               part = req->part;
+               part = disk_map_sector_rcu(req->rq_disk, blk_rq_pos(req));
  
                part_stat_inc(cpu, part, ios[rw]);
                part_stat_add(cpu, part, ticks[rw], duration);