summaryrefslogtreecommitdiffstats
path: root/block/blk-rq-qos.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2018-07-19 21:42:13 -0400
committerJens Axboe <axboe@kernel.dk>2018-07-22 11:30:53 -0600
commit22f17952c7873a427e6e4280d723c0f686d75fb9 (patch)
treeba3046530a5f3dadb9b3e66289027b49531a423c /block/blk-rq-qos.c
parent636620b66d5d4012c4a9c86206013964d3986c4f (diff)
downloadlinux-22f17952c7873a427e6e4280d723c0f686d75fb9.tar.gz
linux-22f17952c7873a427e6e4280d723c0f686d75fb9.tar.bz2
linux-22f17952c7873a427e6e4280d723c0f686d75fb9.zip
blk-rq-qos: make depth comparisons unsigned
With the change to use UINT_MAX I broke the depth check as any value of inflight (ie 0) would be less than (int)UINT_MAX. Fix this by changing everything to unsigned int to match the depth. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-rq-qos.c')
-rw-r--r--block/blk-rq-qos.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-rq-qos.c b/block/blk-rq-qos.c
index 5134b24482f6..0005dfd568dd 100644
--- a/block/blk-rq-qos.c
+++ b/block/blk-rq-qos.c
@@ -4,12 +4,12 @@
* Increment 'v', if 'v' is below 'below'. Returns true if we succeeded,
* false if 'v' + 1 would be bigger than 'below'.
*/
-static bool atomic_inc_below(atomic_t *v, int below)
+static bool atomic_inc_below(atomic_t *v, unsigned int below)
{
- int cur = atomic_read(v);
+ unsigned int cur = atomic_read(v);
for (;;) {
- int old;
+ unsigned int old;
if (cur >= below)
return false;
@@ -22,7 +22,7 @@ static bool atomic_inc_below(atomic_t *v, int below)
return true;
}
-bool rq_wait_inc_below(struct rq_wait *rq_wait, int limit)
+bool rq_wait_inc_below(struct rq_wait *rq_wait, unsigned int limit)
{
return atomic_inc_below(&rq_wait->inflight, limit);
}