From: Jes Sorensen <jsorensen@xxxxxx> This is useful for tracking request latencies, which will be introduced in the follow-on patch. Signed-off-by: Jes Sorensen <jsorensen@xxxxxx> --- block/blk-mq.c | 6 +++--- block/blk-stat.c | 4 ++-- block/blk-stat.h | 6 +++--- block/blk-wbt.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 04652e59b0e9..a1e4c444a10b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -43,7 +43,7 @@ static void blk_mq_poll_stats_start(struct request_queue *q); static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb); -static int blk_mq_poll_stats_bkt(const struct request *rq) +static int blk_mq_poll_stats_bkt(const struct request *rq, u64 value) { int ddir, sectors, bucket; @@ -63,7 +63,7 @@ static int blk_mq_poll_stats_bkt(const struct request *rq) /* * 8 buckets for each of read, write, and discard */ -int blk_req_stats_bkt(const struct request *rq) +int blk_req_stats_bkt(const struct request *rq, u64 value) { int grp, bucket; @@ -3475,7 +3475,7 @@ static unsigned long blk_mq_poll_nsecs(struct request_queue *q, * than ~10 usec. We do use the stats for the relevant IO size * if available which does lead to better estimates. */ - bucket = blk_mq_poll_stats_bkt(rq); + bucket = blk_mq_poll_stats_bkt(rq, 0); if (bucket < 0) return ret; diff --git a/block/blk-stat.c b/block/blk-stat.c index dd5c9c8989a5..812af84b6d1b 100644 --- a/block/blk-stat.c +++ b/block/blk-stat.c @@ -68,7 +68,7 @@ void blk_stat_add(struct request *rq, u64 now) if (!blk_stat_is_active(cb)) continue; - bucket = cb->bucket_fn(rq); + bucket = cb->bucket_fn(rq, value); if (bucket < 0) continue; @@ -103,7 +103,7 @@ static void blk_stat_timer_fn(struct timer_list *t) struct blk_stat_callback * blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *), - int (*bucket_fn)(const struct request *), + int (*bucket_fn)(const struct request *, u64), unsigned int buckets, void *data) { struct blk_stat_callback *cb; diff --git a/block/blk-stat.h b/block/blk-stat.h index d23090b53e12..51abad3775a9 100644 --- a/block/blk-stat.h +++ b/block/blk-stat.h @@ -37,7 +37,7 @@ struct blk_stat_callback { * should be accounted under. Return -1 for no bucket for this * request. */ - int (*bucket_fn)(const struct request *); + int (*bucket_fn)(const struct request *, u64); /** * @buckets: Number of statistics buckets. @@ -83,7 +83,7 @@ void blk_stat_enable_accounting(struct request_queue *q); */ struct blk_stat_callback * blk_stat_alloc_callback(void (*timer_fn)(struct blk_stat_callback *), - int (*bucket_fn)(const struct request *), + int (*bucket_fn)(const struct request *, u64), unsigned int buckets, void *data); /** @@ -168,7 +168,7 @@ void blk_rq_stat_add(struct blk_rq_stat *, u64, u64); void blk_rq_stat_sum(struct blk_rq_stat *, struct blk_rq_stat *); void blk_rq_stat_init(struct blk_rq_stat *); -int blk_req_stats_bkt(const struct request *rq); +int blk_req_stats_bkt(const struct request *rq, u64 value); void blk_req_stats_cb(struct blk_stat_callback *cb); void blk_req_stats_free(struct request_queue *q); #endif diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 8641ba9793c5..9593f7ae3e31 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -669,7 +669,7 @@ u64 wbt_default_latency_nsec(struct request_queue *q) return 75000000ULL; } -static int wbt_data_dir(const struct request *rq) +static int wbt_data_dir(const struct request *rq, u64 value) { const int op = req_op(rq); -- 2.17.1