summaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2009-04-24 08:12:19 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-04-28 07:37:37 +0200
commitc69d48540c201394d08cb4d48b905e001313d9b8 (patch)
tree6ad78b44cd7fc5d65a0c3bded49f8cb14f4790a9 /block/blk.h
parentblock: make blk_do_io_stat() do the full "is this rq accountable" checks (diff)
downloadlinux-c69d48540c201394d08cb4d48b905e001313d9b8.tar.xz
linux-c69d48540c201394d08cb4d48b905e001313d9b8.zip
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. Problem found by Nikanth Karthikesan <knikanth@suse.de> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to '')
-rw-r--r--block/blk.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk.h b/block/blk.h
index 404c10b25ca1..51115599df9b 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -158,7 +158,8 @@ static inline int blk_cpu_to_group(int cpu)
*/
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);
}
#endif