]> git.baikalelectronics.ru Git - kernel.git/commit
block: fix no diskstat problem
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>
Wed, 27 May 2009 12:50:02 +0000 (14:50 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 27 May 2009 12:50:02 +0000 (14:50 +0200)
commit04b79ea0450cad2ed1a0bd1ab3c4a905272dc3b5
tree2315e8e86996c98ddfa74059dc61255317bef0eb
parentc350edf8868e45b1da4b4977fd50a17a695f5c22
block: fix no diskstat problem

The commit below in 2.6-block/for-2.6.31 causes no diskstat problem
because the blk_discard_rq() check was added with '&&'.
It should be 'blk_fs_request() || blk_discard_rq()'.
This patch does it and fixes the no diskstat problem.
Please review and apply.

------ /proc/diskstat without this patch -------------------------------------
   8       0 sda 0 0 0 0 0 0 0 0 0 0 0
------------------------------------------------------------------------------

----- /proc/diskstat with this patch applied ---------------------------------
   8       0 sda 4186 303 373621 61600 9578 3859 107468 169479 2 89755 231059
------------------------------------------------------------------------------

--------------------------------------------------------------------------
commit 3b7b0bb5bf3f4a3ef3c6edb2095a96cb9810e2f6
Author: Jens Axboe <jens.axboe@oracle.com>
Date:   Fri Apr 24 08:12:19 2009 +0200

    block: include discard requests in IO accounting

    We currently don't do merging on discard requests, but we potentially
    could. If we do, then we need to include discard requests in the IO
    accounting, or merging would end up decrementing in_flight IO counters
    for an IO which never incremented them.

    So enable accounting for discard requests.

<snip>

 static inline int blk_do_io_stat(struct request *rq)
 {
-       return rq->rq_disk && blk_rq_io_stat(rq) && blk_fs_request(rq);
+       return rq->rq_disk && blk_rq_io_stat(rq) && blk_fs_request(rq) &&
+               blk_discard_rq(rq);
 }
--------------------------------------------------------------------------

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk.h