mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
blkcg: associate blkg when associating a device
Previously, blkg association was handled by controller specific code in blk-throttle and blk-iolatency. However, because a blkg represents a relationship between a blkcg and a request_queue, it makes sense to keep the blkg->q and bio->bi_disk->queue consistent. This patch moves association into the bio_set_dev macro(). This should cover the majority of cases where the device is set/changed keeping the two pointers consistent. Fallback code is added to blkcg_bio_issue_check() to catch any missing paths. Signed-off-by: Dennis Zhou <[email protected]> Reviewed-by: Josef Bacik <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
892ad71f62
commit
5cdf2e3fea
5 changed files with 14 additions and 12 deletions
|
|
@ -472,14 +472,12 @@ static void check_scale_change(struct iolatency_grp *iolat)
|
|||
static void blkcg_iolatency_throttle(struct rq_qos *rqos, struct bio *bio)
|
||||
{
|
||||
struct blk_iolatency *blkiolat = BLKIOLATENCY(rqos);
|
||||
struct blkcg_gq *blkg;
|
||||
struct blkcg_gq *blkg = bio->bi_blkg;
|
||||
bool issue_as_root = bio_issue_as_root_blkg(bio);
|
||||
|
||||
if (!blk_iolatency_enabled(blkiolat))
|
||||
return;
|
||||
|
||||
bio_associate_blkg(bio);
|
||||
blkg = bio->bi_blkg;
|
||||
bio_issue_init(&bio->bi_issue, bio_sectors(bio));
|
||||
|
||||
while (blkg && blkg->parent) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue