Commit d2f31a5f authored by Joe Perches's avatar Joe Perches Committed by Jens Axboe

blk-throttle: Make total_nr_queued unsigned

The total of two unsigned values should also be unsigned.

Update throtl_log output to unsigned.
Update total_nr_queued test to non-zero to be the
same as the other total_nr_queued tests.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <jaxboe@fusionio.com>
parent fd16d263
...@@ -142,9 +142,9 @@ static inline struct throtl_grp *tg_of_blkg(struct blkio_group *blkg) ...@@ -142,9 +142,9 @@ static inline struct throtl_grp *tg_of_blkg(struct blkio_group *blkg)
return NULL; return NULL;
} }
static inline int total_nr_queued(struct throtl_data *td) static inline unsigned int total_nr_queued(struct throtl_data *td)
{ {
return (td->nr_queued[0] + td->nr_queued[1]); return td->nr_queued[0] + td->nr_queued[1];
} }
static inline struct throtl_grp *throtl_ref_get_tg(struct throtl_grp *tg) static inline struct throtl_grp *throtl_ref_get_tg(struct throtl_grp *tg)
...@@ -927,7 +927,7 @@ static int throtl_dispatch(struct request_queue *q) ...@@ -927,7 +927,7 @@ static int throtl_dispatch(struct request_queue *q)
bio_list_init(&bio_list_on_stack); bio_list_init(&bio_list_on_stack);
throtl_log(td, "dispatch nr_queued=%d read=%u write=%u", throtl_log(td, "dispatch nr_queued=%u read=%u write=%u",
total_nr_queued(td), td->nr_queued[READ], total_nr_queued(td), td->nr_queued[READ],
td->nr_queued[WRITE]); td->nr_queued[WRITE]);
...@@ -970,7 +970,7 @@ throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay) ...@@ -970,7 +970,7 @@ throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay)
struct delayed_work *dwork = &td->throtl_work; struct delayed_work *dwork = &td->throtl_work;
/* schedule work if limits changed even if no bio is queued */ /* schedule work if limits changed even if no bio is queued */
if (total_nr_queued(td) > 0 || td->limits_changed) { if (total_nr_queued(td) || td->limits_changed) {
/* /*
* We might have a work scheduled to be executed in future. * We might have a work scheduled to be executed in future.
* Cancel that and schedule a new one. * Cancel that and schedule a new one.
......
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