Commit 0b6bad7d authored by Chengguang Xu's avatar Chengguang Xu Committed by Jens Axboe

blk-throttle: return proper bool type to caller instead of 0/1

Change to return true/false only for bool type return code.
Signed-off-by: default avatarChengguang Xu <cgxu519@gmx.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d250bf4e
...@@ -819,7 +819,7 @@ static bool throtl_slice_used(struct throtl_grp *tg, bool rw) ...@@ -819,7 +819,7 @@ static bool throtl_slice_used(struct throtl_grp *tg, bool rw)
if (time_in_range(jiffies, tg->slice_start[rw], tg->slice_end[rw])) if (time_in_range(jiffies, tg->slice_start[rw], tg->slice_end[rw]))
return false; return false;
return 1; return true;
} }
/* Trim the used slices and adjust slice start accordingly */ /* Trim the used slices and adjust slice start accordingly */
...@@ -929,7 +929,7 @@ static bool tg_with_in_iops_limit(struct throtl_grp *tg, struct bio *bio, ...@@ -929,7 +929,7 @@ static bool tg_with_in_iops_limit(struct throtl_grp *tg, struct bio *bio,
if (wait) if (wait)
*wait = jiffy_wait; *wait = jiffy_wait;
return 0; return false;
} }
static bool tg_with_in_bps_limit(struct throtl_grp *tg, struct bio *bio, static bool tg_with_in_bps_limit(struct throtl_grp *tg, struct bio *bio,
...@@ -972,7 +972,7 @@ static bool tg_with_in_bps_limit(struct throtl_grp *tg, struct bio *bio, ...@@ -972,7 +972,7 @@ static bool tg_with_in_bps_limit(struct throtl_grp *tg, struct bio *bio,
jiffy_wait = jiffy_wait + (jiffy_elapsed_rnd - jiffy_elapsed); jiffy_wait = jiffy_wait + (jiffy_elapsed_rnd - jiffy_elapsed);
if (wait) if (wait)
*wait = jiffy_wait; *wait = jiffy_wait;
return 0; return false;
} }
/* /*
...@@ -1022,7 +1022,7 @@ static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio, ...@@ -1022,7 +1022,7 @@ static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio,
tg_with_in_iops_limit(tg, bio, &iops_wait)) { tg_with_in_iops_limit(tg, bio, &iops_wait)) {
if (wait) if (wait)
*wait = 0; *wait = 0;
return 1; return true;
} }
max_wait = max(bps_wait, iops_wait); max_wait = max(bps_wait, iops_wait);
...@@ -1033,7 +1033,7 @@ static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio, ...@@ -1033,7 +1033,7 @@ static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio,
if (time_before(tg->slice_end[rw], jiffies + max_wait)) if (time_before(tg->slice_end[rw], jiffies + max_wait))
throtl_extend_slice(tg, rw, jiffies + max_wait); throtl_extend_slice(tg, rw, jiffies + max_wait);
return 0; return false;
} }
static void throtl_charge_bio(struct throtl_grp *tg, struct bio *bio) static void throtl_charge_bio(struct throtl_grp *tg, struct bio *bio)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment