diff options
author | Omar Sandoval <osandov@fb.com> | 2017-03-21 11:56:06 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-03-21 12:03:08 -0400 |
commit | fa2e39cb9ee78f440d99a1bcfa47462c48a6fc11 (patch) | |
tree | f52d01dd11fabdbe05388ce755af699d7c38bf80 /block/blk-wbt.c | |
parent | 0315b159085621d2ff72dbf69ca6fb4a5b32bae2 (diff) |
blk-stat: use READ and WRITE instead of BLK_STAT_{READ,WRITE}
The stats buckets will become generic soon, so make the existing users
use the common READ and WRITE definitions instead of one internal to
blk-stat.
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-wbt.c')
-rw-r--r-- | block/blk-wbt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 1aedb1f7ee0c..aafe5b551224 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c | |||
@@ -255,8 +255,8 @@ static inline bool stat_sample_valid(struct blk_rq_stat *stat) | |||
255 | * that it's writes impacting us, and not just some sole read on | 255 | * that it's writes impacting us, and not just some sole read on |
256 | * a device that is in a lower power state. | 256 | * a device that is in a lower power state. |
257 | */ | 257 | */ |
258 | return stat[BLK_STAT_READ].nr_samples >= 1 && | 258 | return (stat[READ].nr_samples >= 1 && |
259 | stat[BLK_STAT_WRITE].nr_samples >= RWB_MIN_WRITE_SAMPLES; | 259 | stat[WRITE].nr_samples >= RWB_MIN_WRITE_SAMPLES); |
260 | } | 260 | } |
261 | 261 | ||
262 | static u64 rwb_sync_issue_lat(struct rq_wb *rwb) | 262 | 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) | |||
293 | */ | 293 | */ |
294 | thislat = rwb_sync_issue_lat(rwb); | 294 | thislat = rwb_sync_issue_lat(rwb); |
295 | if (thislat > rwb->cur_win_nsec || | 295 | if (thislat > rwb->cur_win_nsec || |
296 | (thislat > rwb->min_lat_nsec && !stat[BLK_STAT_READ].nr_samples)) { | 296 | (thislat > rwb->min_lat_nsec && !stat[READ].nr_samples)) { |
297 | trace_wbt_lat(bdi, thislat); | 297 | trace_wbt_lat(bdi, thislat); |
298 | return LAT_EXCEEDED; | 298 | return LAT_EXCEEDED; |
299 | } | 299 | } |
@@ -308,7 +308,7 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat) | |||
308 | * waited or still has writes in flights, consider us doing | 308 | * waited or still has writes in flights, consider us doing |
309 | * just writes as well. | 309 | * just writes as well. |
310 | */ | 310 | */ |
311 | if ((stat[BLK_STAT_WRITE].nr_samples && blk_stat_is_current(stat)) || | 311 | if ((stat[WRITE].nr_samples && blk_stat_is_current(stat)) || |
312 | wb_recent_wait(rwb) || wbt_inflight(rwb)) | 312 | wb_recent_wait(rwb) || wbt_inflight(rwb)) |
313 | return LAT_UNKNOWN_WRITES; | 313 | return LAT_UNKNOWN_WRITES; |
314 | return LAT_UNKNOWN; | 314 | return LAT_UNKNOWN; |
@@ -317,8 +317,8 @@ static int __latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat) | |||
317 | /* | 317 | /* |
318 | * If the 'min' latency exceeds our target, step down. | 318 | * If the 'min' latency exceeds our target, step down. |
319 | */ | 319 | */ |
320 | if (stat[BLK_STAT_READ].min > rwb->min_lat_nsec) { | 320 | if (stat[READ].min > rwb->min_lat_nsec) { |
321 | trace_wbt_lat(bdi, stat[BLK_STAT_READ].min); | 321 | trace_wbt_lat(bdi, stat[READ].min); |
322 | trace_wbt_stat(bdi, stat); | 322 | trace_wbt_stat(bdi, stat); |
323 | return LAT_EXCEEDED; | 323 | return LAT_EXCEEDED; |
324 | } | 324 | } |