]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block, bfq: cleanup bfq_bfqq_to_bfqg()
authorYu Kuai <yukuai3@huawei.com>
Sat, 29 Jan 2022 01:59:22 +0000 (09:59 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 18 Feb 2022 13:13:00 +0000 (06:13 -0700)
Use bfq_group() instead, which do the same thing.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Paolo Valente <paolo.valente@linaro.org>
Link: https://lore.kernel.org/r/20220129015924.3958918-2-yukuai3@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-iosched.c
block/bfq-iosched.h
block/bfq-wf2q.c

index 0c612a9116967ef03901bd99ab3170ad9ef8ffa9..2f2b97cad9802fb9768f944590812ad33921c1b6 100644 (file)
@@ -774,7 +774,7 @@ bfq_pos_tree_add_move(struct bfq_data *bfqd, struct bfq_queue *bfqq)
        if (!bfqq->next_rq)
                return;
 
-       bfqq->pos_root = &bfq_bfqq_to_bfqg(bfqq)->rq_pos_tree;
+       bfqq->pos_root = &bfqq_group(bfqq)->rq_pos_tree;
        __bfqq = bfq_rq_pos_tree_lookup(bfqd, bfqq->pos_root,
                        blk_rq_pos(bfqq->next_rq), &parent, &p);
        if (!__bfqq) {
@@ -2669,7 +2669,7 @@ static struct bfq_queue *bfqq_find_close(struct bfq_data *bfqd,
                                         struct bfq_queue *bfqq,
                                         sector_t sector)
 {
-       struct rb_root *root = &bfq_bfqq_to_bfqg(bfqq)->rq_pos_tree;
+       struct rb_root *root = &bfqq_group(bfqq)->rq_pos_tree;
        struct rb_node *parent, *node;
        struct bfq_queue *__bfqq;
 
index 72255ec44f8f82130f5b0e6ab2b56b65c165c6bb..3b83e3d1c2e5879af814292ba3d095f1ef3f926b 100644 (file)
@@ -1050,7 +1050,6 @@ extern struct blkcg_policy blkcg_policy_bfq;
        for (parent = NULL; entity ; entity = parent)
 #endif /* CONFIG_BFQ_GROUP_IOSCHED */
 
-struct bfq_group *bfq_bfqq_to_bfqg(struct bfq_queue *bfqq);
 struct bfq_queue *bfq_entity_to_bfqq(struct bfq_entity *entity);
 unsigned int bfq_tot_busy_queues(struct bfq_data *bfqd);
 struct bfq_service_tree *bfq_entity_service_tree(struct bfq_entity *entity);
index 709b901de3ca9d321155f596eb69ae8a627d331c..f8eb340381cf1e0349b3169f07a0db3c24e5e2da 100644 (file)
@@ -142,16 +142,6 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
 
 #ifdef CONFIG_BFQ_GROUP_IOSCHED
 
-struct bfq_group *bfq_bfqq_to_bfqg(struct bfq_queue *bfqq)
-{
-       struct bfq_entity *group_entity = bfqq->entity.parent;
-
-       if (!group_entity)
-               group_entity = &bfqq->bfqd->root_group->entity;
-
-       return container_of(group_entity, struct bfq_group, entity);
-}
-
 /*
  * Returns true if this budget changes may let next_in_service->parent
  * become the next_in_service entity for its parent entity.
@@ -230,11 +220,6 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity)
 
 #else /* CONFIG_BFQ_GROUP_IOSCHED */
 
-struct bfq_group *bfq_bfqq_to_bfqg(struct bfq_queue *bfqq)
-{
-       return bfqq->bfqd->root_group;
-}
-
 static bool bfq_update_parent_budget(struct bfq_entity *next_in_service)
 {
        return false;