Skip to content

Commit

Permalink
block: account merge of two requests
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
koct9i authored and axboe committed May 27, 2020
1 parent 58d4f14 commit b9c54f5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions block/blk-merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,18 +669,16 @@ void blk_rq_set_mixed_merge(struct request *rq)
rq->rq_flags |= RQF_MIXED_MERGE;
}

static void blk_account_io_merge(struct request *req)
static void blk_account_io_merge_request(struct request *req)
{
if (blk_do_io_stat(req)) {
struct hd_struct *part;

part_stat_lock();
part = req->part;

hd_struct_put(part);
part_stat_inc(req->part, merges[op_stat_group(req_op(req))]);
hd_struct_put(req->part);
part_stat_unlock();
}
}

/*
* Two cases of handling DISCARD merge:
* If max_discard_segments > 1, the driver takes every bio
Expand Down Expand Up @@ -792,7 +790,7 @@ static struct request *attempt_merge(struct request_queue *q,
/*
* 'next' is going away, so update stats accordingly
*/
blk_account_io_merge(next);
blk_account_io_merge_request(next);

/*
* ownership of bio passed from next to req, return 'next' for
Expand Down

0 comments on commit b9c54f5

Please sign in to comment.