summaryrefslogtreecommitdiffstats
path: root/block/blk-wbt.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-11-11 08:23:53 -0700
committerJens Axboe <axboe@fb.com>2016-11-11 16:18:29 -0700
commit382cf633edcb0371a6dd506653014897c4ac2a4d (patch)
tree85e190ec6239a4b57f72eb96c034a78279ba8546 /block/blk-wbt.c
parent8054b89f8fca75d514965ee627a15b47020d2053 (diff)
downloadlinux-382cf633edcb0371a6dd506653014897c4ac2a4d.tar.bz2
blk-wbt: use BLK_STAT_{READ,WRITE} instead of 0/1
Since we have proper enums for the stats directions, use them. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-wbt.c')
-rw-r--r--block/blk-wbt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index f6ec7e587fa6..20712f0db6ea 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -255,8 +255,8 @@ static bool inline stat_sample_valid(struct blk_rq_stat *stat)
* that it's writes impacting us, and not just some sole read on
* a device that is in a lower power state.
*/
- return stat[0].nr_samples >= 1 &&
- stat[1].nr_samples >= RWB_MIN_WRITE_SAMPLES;
+ return stat[BLK_STAT_READ].nr_samples >= 1 &&
+ stat[BLK_STAT_WRITE].nr_samples >= RWB_MIN_WRITE_SAMPLES;
}
static u64 rwb_sync_issue_lat(struct rq_wb *rwb)
@@ -293,7 +293,7 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
*/
thislat = rwb_sync_issue_lat(rwb);
if (thislat > rwb->cur_win_nsec ||
- (thislat > rwb->min_lat_nsec && !stat[0].nr_samples)) {
+ (thislat > rwb->min_lat_nsec && !stat[BLK_STAT_READ].nr_samples)) {
trace_wbt_lat(bdi, thislat);
return LAT_EXCEEDED;
}
@@ -308,7 +308,7 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
* waited or still has writes in flights, consider us doing
* just writes as well.
*/
- if ((stat[1].nr_samples && blk_stat_is_current(stat)) ||
+ if ((stat[BLK_STAT_WRITE].nr_samples && blk_stat_is_current(stat)) ||
wb_recent_wait(rwb) || wbt_inflight(rwb))
return LAT_UNKNOWN_WRITES;
return LAT_UNKNOWN;
@@ -317,8 +317,8 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
/*
* If the 'min' latency exceeds our target, step down.
*/
- if (stat[0].min > rwb->min_lat_nsec) {
- trace_wbt_lat(bdi, stat[0].min);
+ if (stat[BLK_STAT_READ].min > rwb->min_lat_nsec) {
+ trace_wbt_lat(bdi, stat[BLK_STAT_READ].min);
trace_wbt_stat(bdi, stat);
return LAT_EXCEEDED;
}