summaryrefslogtreecommitdiffstats
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-05-29 18:32:44 +0800
committerJens Axboe <axboe@kernel.dk>2018-05-30 12:48:22 -0600
commit0b6bad7d669ef2abd3b9e1f8cee1fbd448abbc5c (patch)
tree62697568a430844c9903b658859a955e4505580f /block/blk-throttle.c
parentd250bf4e776ff09d51c97f83c7a19f65a9e1c5a5 (diff)
downloadlinux-0-day-0b6bad7d669ef2abd3b9e1f8cee1fbd448abbc5c.tar.gz
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: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r--block/blk-throttle.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 35bed77..82282e6 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -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]))
return false;
- return 1;
+ return true;
}
/* 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,
if (wait)
*wait = jiffy_wait;
- return 0;
+ return false;
}
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);
if (wait)
*wait = jiffy_wait;
- return 0;
+ return false;
}
/*
@@ -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)) {
if (wait)
*wait = 0;
- return 1;
+ return true;
}
max_wait = max(bps_wait, iops_wait);
@@ -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))
throtl_extend_slice(tg, rw, jiffies + max_wait);
- return 0;
+ return false;
}
static void throtl_charge_bio(struct throtl_grp *tg, struct bio *bio)