Skip to content

Commit b9c54f5

Browse files
koct9iaxboe
authored andcommitted
block: account merge of two requests
Also rename blk_account_io_merge() into blk_account_io_merge_request() to distinguish it from merging request and bio. [hch: rebased] Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 58d4f14 commit b9c54f5

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎block/blk-merge.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,18 +669,16 @@ void blk_rq_set_mixed_merge(struct request *rq)
669669
rq->rq_flags |= RQF_MIXED_MERGE;
670670
}
671671

672-
static void blk_account_io_merge(struct request *req)
672+
static void blk_account_io_merge_request(struct request *req)
673673
{
674674
if (blk_do_io_stat(req)) {
675-
struct hd_struct *part;
676-
677675
part_stat_lock();
678-
part = req->part;
679-
680-
hd_struct_put(part);
676+
part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
677+
hd_struct_put(req->part);
681678
part_stat_unlock();
682679
}
683680
}
681+
684682
/*
685683
* Two cases of handling DISCARD merge:
686684
* If max_discard_segments > 1, the driver takes every bio
@@ -792,7 +790,7 @@ static struct request *attempt_merge(struct request_queue *q,
792790
/*
793791
* 'next' is going away, so update stats accordingly
794792
*/
795-
blk_account_io_merge(next);
793+
blk_account_io_merge_request(next);
796794

797795
/*
798796
* ownership of bio passed from next to req, return 'next' for

0 commit comments

Comments
 (0)