From: Jens Axboe Date: Fri, 24 Apr 2009 06:12:19 +0000 (+0200) Subject: block: include discard requests in IO accounting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c69d48540c201394d08cb4d48b905e001313d9b8;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Signed-off-by: Jens Axboe --- diff --git a/block/blk.h b/block/blk.h index 404c10b25ca..51115599df9 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