blk-throttle: Re-use the throtl_set_slice_end()
authorBaolin Wang <baolin.wang@linux.alibaba.com>
Thu, 8 Oct 2020 03:52:29 +0000 (11:52 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Oct 2020 14:01:38 +0000 (08:01 -0600)
Re-use throtl_set_slice_end() to remove duplicate code.

Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-throttle.c

index fc5c14f..b771c42 100644 (file)
@@ -808,7 +808,7 @@ static inline void throtl_set_slice_end(struct throtl_grp *tg, bool rw,
 static inline void throtl_extend_slice(struct throtl_grp *tg, bool rw,
                                       unsigned long jiffy_end)
 {
-       tg->slice_end[rw] = roundup(jiffy_end, tg->td->throtl_slice);
+       throtl_set_slice_end(tg, rw, jiffy_end);
        throtl_log(&tg->service_queue,
                   "[%c] extend slice start=%lu end=%lu jiffies=%lu",
                   rw == READ ? 'R' : 'W', tg->slice_start[rw],