Skip to content

Commit f45916a

Browse files
YuKuai-huaweiaxboe
authored andcommitted
block, bfq: use bfq_reassign_last_bfqq() in bfq_bfqq_move()
Instead of open coding it, there are no functional changes. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 42c306e commit f45916a

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

block/bfq-cgroup.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,7 @@ void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
679679
bfq_put_idle_entity(bfq_entity_service_tree(entity), entity);
680680
bfqg_and_blkg_put(old_parent);
681681

682-
if (entity->parent &&
683-
entity->parent->last_bfqq_created == bfqq)
684-
entity->parent->last_bfqq_created = NULL;
685-
else if (bfqd->last_bfqq_created == bfqq)
686-
bfqd->last_bfqq_created = NULL;
687-
682+
bfq_reassign_last_bfqq(bfqq, NULL);
688683
entity->parent = bfqg->my_entity;
689684
entity->sched_data = &bfqg->sched_data;
690685
/* pin down bfqg and its associated blkg */

block/bfq-iosched.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3097,8 +3097,8 @@ static void bfq_bfqq_save_state(struct bfq_queue *bfqq)
30973097
}
30983098

30993099

3100-
static void
3101-
bfq_reassign_last_bfqq(struct bfq_queue *cur_bfqq, struct bfq_queue *new_bfqq)
3100+
void bfq_reassign_last_bfqq(struct bfq_queue *cur_bfqq,
3101+
struct bfq_queue *new_bfqq)
31023102
{
31033103
if (cur_bfqq->entity.parent &&
31043104
cur_bfqq->entity.parent->last_bfqq_created == cur_bfqq)

block/bfq-iosched.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,6 +1156,8 @@ void bfq_del_bfqq_busy(struct bfq_queue *bfqq, bool expiration);
11561156
void bfq_add_bfqq_busy(struct bfq_queue *bfqq);
11571157
void bfq_add_bfqq_in_groups_with_pending_reqs(struct bfq_queue *bfqq);
11581158
void bfq_del_bfqq_in_groups_with_pending_reqs(struct bfq_queue *bfqq);
1159+
void bfq_reassign_last_bfqq(struct bfq_queue *cur_bfqq,
1160+
struct bfq_queue *new_bfqq);
11591161

11601162
/* --------------- end of interface of B-WF2Q+ ---------------- */
11611163

0 commit comments

Comments
 (0)