Skip to content

Commit

Permalink
blk-throttle: correctly determine sync bio
Browse files Browse the repository at this point in the history
read request is always sync. Using rw_is_sync() to determine
if a bio is sync.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Aug 1, 2011
1 parent 05eb0f2 commit e5a94f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ static bool tg_may_dispatch(struct throtl_data *td, struct throtl_grp *tg,
static void throtl_charge_bio(struct throtl_grp *tg, struct bio *bio)
{
bool rw = bio_data_dir(bio);
bool sync = bio->bi_rw & REQ_SYNC;
bool sync = rw_is_sync(bio->bi_rw);

/* Charge the bio to the group */
tg->bytes_disp[rw] += bio->bi_size;
Expand Down Expand Up @@ -1150,7 +1150,7 @@ int blk_throtl_bio(struct request_queue *q, struct bio **biop)

if (tg_no_rule_group(tg, rw)) {
blkiocg_update_dispatch_stats(&tg->blkg, bio->bi_size,
rw, bio->bi_rw & REQ_SYNC);
rw, rw_is_sync(bio->bi_rw));
rcu_read_unlock();
return 0;
}
Expand Down

0 comments on commit e5a94f5

Please sign in to comment.