blk-wbt: don't show valid wbt_lat_usec in sysfs while wbt is disabled
[linux-2.6-microblaze.git] / block / blk-wbt.c
index 4680691..07ed0b0 100644 (file)
@@ -422,6 +422,14 @@ static void wbt_update_limits(struct rq_wb *rwb)
        rwb_wake_all(rwb);
 }
 
+bool wbt_disabled(struct request_queue *q)
+{
+       struct rq_qos *rqos = wbt_rq_qos(q);
+
+       return !rqos || RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT ||
+              RQWB(rqos)->enable_state == WBT_STATE_OFF_MANUAL;
+}
+
 u64 wbt_get_min_lat(struct request_queue *q)
 {
        struct rq_qos *rqos = wbt_rq_qos(q);