alistair23-linux/block
Kiyoshi Ueda 3c4198e874 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 c69d48540c
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>
2009-05-27 14:50:02 +02:00
..
as-iosched.c block: convert to pos and nr_sectors accessors 2009-05-11 09:50:54 +02:00
blk-barrier.c block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00
blk-core.c block: fix oops with block tag queueing 2009-05-27 14:17:08 +02:00
blk-exec.c block: don't set REQ_NOMERGE unnecessarily 2009-04-28 07:37:33 +02:00
blk-integrity.c block: Do away with the notion of hardsect_size 2009-05-22 23:22:54 +02:00
blk-ioc.c
blk-map.c block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00
blk-merge.c block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00
blk-settings.c block: Export I/O topology for block devices and partitions 2009-05-22 23:22:55 +02:00
blk-softirq.c generic-ipi: remove CSD_FLAG_WAIT 2009-02-25 14:13:44 +01:00
blk-sysfs.c block: Export I/O topology for block devices and partitions 2009-05-22 23:22:55 +02:00
blk-tag.c block: change the tag sync vs async restriction logic 2009-05-20 08:54:31 +02:00
blk-timeout.c block: clean up misc stuff after block layer timeout conversion 2009-04-28 07:37:34 +02:00
blk.h block: fix no diskstat problem 2009-05-27 14:50:02 +02:00
bsg.c block: add rq->resid_len 2009-05-11 09:50:53 +02:00
cfq-iosched.c block: drop request->hard_* and *nr_sectors 2009-05-11 09:50:54 +02:00
cmd-filter.c [SCSI] Make scsi.h independent of the rest of the scsi includes 2009-03-12 12:58:13 -05:00
compat_ioctl.c block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00
deadline-iosched.c block: convert to pos and nr_sectors accessors 2009-05-11 09:50:54 +02:00
elevator.c block: Expose stacked device queues in sysfs 2009-05-22 23:22:55 +02:00
genhd.c block: Export I/O topology for block devices and partitions 2009-05-22 23:22:55 +02:00
ioctl.c block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00
Kconfig block: enable by default support for large devices and files on 32-bit archs 2009-04-28 07:37:33 +02:00
Kconfig.iosched
Makefile tracing/blktrace: move the tracing file to kernel/trace 2009-02-09 10:51:02 +01:00
noop-iosched.c block: get rid of elevator_t typedef 2008-12-29 08:29:50 +01:00
scsi_ioctl.c block: Use accessor functions for queue limits 2009-05-22 23:22:54 +02:00