summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/blk-wbt.c23
-rw-r--r--block/blk-wbt.h10
2 files changed, 22 insertions, 11 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index 1345935c7ee6..2512442873d4 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -277,6 +277,27 @@ enum {
LAT_EXCEEDED,
};
+static bool wbt_any_inflight(struct rq_wb *rwb)
+{
+ unsigned int i;
+
+ for (i = 0; i < WBT_NUM_RWQ; i++)
+ if (atomic_read(&rwb->rq_wait[i].inflight))
+ return true;
+
+ return false;
+}
+
+static unsigned int wbt_inflight(struct rq_wb *rwb)
+{
+ unsigned int i, ret = 0;
+
+ for (i = 0; i < WBT_NUM_RWQ; i++)
+ ret += atomic_read(&rwb->rq_wait[i].inflight);
+
+ return ret;
+}
+
static int latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
{
struct backing_dev_info *bdi = rwb->queue->backing_dev_info;
@@ -309,7 +330,7 @@ static int latency_exceeded(struct rq_wb *rwb, struct blk_rq_stat *stat)
* just writes as well.
*/
if (stat[WRITE].nr_samples || wb_recent_wait(rwb) ||
- wbt_inflight(rwb))
+ wbt_any_inflight(rwb))
return LAT_UNKNOWN_WRITES;
return LAT_UNKNOWN;
}
diff --git a/block/blk-wbt.h b/block/blk-wbt.h
index df6de50c5d59..e7c086374e20 100644
--- a/block/blk-wbt.h
+++ b/block/blk-wbt.h
@@ -96,16 +96,6 @@ struct rq_wb {
struct rq_wait rq_wait[WBT_NUM_RWQ];
};
-static inline unsigned int wbt_inflight(struct rq_wb *rwb)
-{
- unsigned int i, ret = 0;
-
- for (i = 0; i < WBT_NUM_RWQ; i++)
- ret += atomic_read(&rwb->rq_wait[i].inflight);
-
- return ret;
-}
-
#ifdef CONFIG_BLK_WBT
void __wbt_done(struct rq_wb *, enum wbt_flags);