aboutsummaryrefslogtreecommitdiff
path: root/block/blk-wbt.c
diff options
context:
space:
mode:
authorOmar Sandoval2018-05-09 02:08:47 -0700
committerJens Axboe2018-05-09 08:33:00 -0600
commit934031a12980511c020acf7d91f9035e34d0b5b8 (patch)
tree510dde2e8e992a1a7bf4f112de5e2a419ceab823 /block/blk-wbt.c
parent782f569774d7000e54ae9d680b0e4cd29b1c7ca3 (diff)
block: move some wbt helpers to blk-wbt.c
A few helpers are only used from blk-wbt.c, so move them there, and put wbt_track() behind the CONFIG_BLK_WBT typedef. This is in preparation for changing how the wbt flags are tracked. Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-wbt.c')
-rw-r--r--block/blk-wbt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/block/blk-wbt.c b/block/blk-wbt.c
index a7a724580033..450cffa85dfb 100644
--- a/block/blk-wbt.c
+++ b/block/blk-wbt.c
@@ -29,6 +29,26 @@
#define CREATE_TRACE_POINTS
#include <trace/events/wbt.h>
+static inline void wbt_clear_state(struct blk_issue_stat *stat)
+{
+ stat->stat &= ~BLK_STAT_RES_MASK;
+}
+
+static inline enum wbt_flags wbt_stat_to_mask(struct blk_issue_stat *stat)
+{
+ return (stat->stat & BLK_STAT_RES_MASK) >> BLK_STAT_RES_SHIFT;
+}
+
+static inline bool wbt_is_tracked(struct blk_issue_stat *stat)
+{
+ return (stat->stat >> BLK_STAT_RES_SHIFT) & WBT_TRACKED;
+}
+
+static inline bool wbt_is_read(struct blk_issue_stat *stat)
+{
+ return (stat->stat >> BLK_STAT_RES_SHIFT) & WBT_READ;
+}
+
enum {
/*
* Default setting, we'll scale up (to 75% of QD max) or down (min 1)