Skip to content

Commit 4d8340d

Browse files
Algodev-githubaxboe
authored andcommitted
block, bfq: remove ifdefs from around gets/puts of bfq groups
ifdefs around gets and puts of bfq groups reduce readability, remove them. Tested-by: Oleksandr Natalenko <[email protected]> Reported-by: Jens Axboe <[email protected]> Signed-off-by: Paolo Valente <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 33a16a9 commit 4d8340d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

block/bfq-cgroup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,10 @@ struct bfq_group *bfqq_group(struct bfq_queue *bfqq)
14061406
return bfqq->bfqd->root_group;
14071407
}
14081408

1409+
void bfqg_and_blkg_get(struct bfq_group *bfqg) {}
1410+
1411+
void bfqg_and_blkg_put(struct bfq_group *bfqg) {}
1412+
14091413
struct bfq_group *bfq_create_group_hierarchy(struct bfq_data *bfqd, int node)
14101414
{
14111415
struct bfq_group *bfqg;

block/bfq-iosched.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,9 +4825,7 @@ void bfq_put_queue(struct bfq_queue *bfqq)
48254825
{
48264826
struct bfq_queue *item;
48274827
struct hlist_node *n;
4828-
#ifdef CONFIG_BFQ_GROUP_IOSCHED
48294828
struct bfq_group *bfqg = bfqq_group(bfqq);
4830-
#endif
48314829

48324830
if (bfqq->bfqd)
48334831
bfq_log_bfqq(bfqq->bfqd, bfqq, "put_queue: %p %d",
@@ -4900,9 +4898,7 @@ void bfq_put_queue(struct bfq_queue *bfqq)
49004898
bfqq->bfqd->last_completed_rq_bfqq = NULL;
49014899

49024900
kmem_cache_free(bfq_pool, bfqq);
4903-
#ifdef CONFIG_BFQ_GROUP_IOSCHED
49044901
bfqg_and_blkg_put(bfqg);
4905-
#endif
49064902
}
49074903

49084904
static void bfq_put_cooperator(struct bfq_queue *bfqq)
@@ -6390,10 +6386,10 @@ static void bfq_exit_queue(struct elevator_queue *e)
63906386

63916387
hrtimer_cancel(&bfqd->idle_slice_timer);
63926388

6393-
#ifdef CONFIG_BFQ_GROUP_IOSCHED
63946389
/* release oom-queue reference to root group */
63956390
bfqg_and_blkg_put(bfqd->root_group);
63966391

6392+
#ifdef CONFIG_BFQ_GROUP_IOSCHED
63976393
blkcg_deactivate_policy(bfqd->queue, &blkcg_policy_bfq);
63986394
#else
63996395
spin_lock_irq(&bfqd->lock);

block/bfq-iosched.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ struct bfq_group {
921921

922922
#else
923923
struct bfq_group {
924+
struct bfq_entity entity;
924925
struct bfq_sched_data sched_data;
925926

926927
struct bfq_queue *async_bfqq[2][IOPRIO_BE_NR];

0 commit comments

Comments
 (0)