Commit 689665af4489f779bc82e7869509c9ac11b5a903
1 parent
810ecfa765
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
cfq-iosched: separate out cfqg_stats_reset() from cfq_pd_reset_stats()
Separate out cfqg_stats_reset() which takes struct cfqg_stats * from cfq_pd_reset_stats() and move the latter to where other pd methods are defined. cfqg_stats_reset() will be used to implement hierarchical stats. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Vivek Goyal <vgoyal@redhat.com>
Showing 1 changed file with 9 additions and 4 deletions Side-by-side Diff
block/cfq-iosched.c
... | ... | @@ -688,11 +688,9 @@ |
688 | 688 | io_start_time - start_time); |
689 | 689 | } |
690 | 690 | |
691 | -static void cfq_pd_reset_stats(struct blkcg_gq *blkg) | |
691 | +/* @stats = 0 */ | |
692 | +static void cfqg_stats_reset(struct cfqg_stats *stats) | |
692 | 693 | { |
693 | - struct cfq_group *cfqg = blkg_to_cfqg(blkg); | |
694 | - struct cfqg_stats *stats = &cfqg->stats; | |
695 | - | |
696 | 694 | /* queued stats shouldn't be cleared */ |
697 | 695 | blkg_rwstat_reset(&stats->service_bytes); |
698 | 696 | blkg_rwstat_reset(&stats->serviced); |
... | ... | @@ -1475,6 +1473,13 @@ |
1475 | 1473 | cfq_init_cfqg_base(cfqg); |
1476 | 1474 | cfqg->weight = blkg->blkcg->cfq_weight; |
1477 | 1475 | cfqg->leaf_weight = blkg->blkcg->cfq_leaf_weight; |
1476 | +} | |
1477 | + | |
1478 | +static void cfq_pd_reset_stats(struct blkcg_gq *blkg) | |
1479 | +{ | |
1480 | + struct cfq_group *cfqg = blkg_to_cfqg(blkg); | |
1481 | + | |
1482 | + cfqg_stats_reset(&cfqg->stats); | |
1478 | 1483 | } |
1479 | 1484 | |
1480 | 1485 | /* |