summaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-06 06:26:22 -0400
committerJens Axboe <axboe@kernel.dk>2019-06-20 12:32:34 -0400
commitc0ce79dca5b0e8373a546ebea2af7b3df94c584e (patch)
tree2039ddde7e970451a75d78b433177b0b42199282 /block/blk-cgroup.c
parent7af6fd9112ba310a889c60d0606b4b74049cfe14 (diff)
blk-cgroup: move struct blkg_stat to bfq
This structure and assorted infrastructure is only used by the bfq I/O scheduler. Move it there instead of bloating the common code. Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Paolo Valente <paolo.valente@linaro.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 664c09866839..53b7bd4c7000 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -573,20 +573,6 @@ u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
573EXPORT_SYMBOL_GPL(__blkg_prfill_rwstat); 573EXPORT_SYMBOL_GPL(__blkg_prfill_rwstat);
574 574
575/** 575/**
576 * blkg_prfill_stat - prfill callback for blkg_stat
577 * @sf: seq_file to print to
578 * @pd: policy private data of interest
579 * @off: offset to the blkg_stat in @pd
580 *
581 * prfill callback for printing a blkg_stat.
582 */
583u64 blkg_prfill_stat(struct seq_file *sf, struct blkg_policy_data *pd, int off)
584{
585 return __blkg_prfill_u64(sf, pd, blkg_stat_read((void *)pd + off));
586}
587EXPORT_SYMBOL_GPL(blkg_prfill_stat);
588
589/**
590 * blkg_prfill_rwstat - prfill callback for blkg_rwstat 576 * blkg_prfill_rwstat - prfill callback for blkg_rwstat
591 * @sf: seq_file to print to 577 * @sf: seq_file to print to
592 * @pd: policy private data of interest 578 * @pd: policy private data of interest
@@ -688,48 +674,6 @@ int blkg_print_stat_ios_recursive(struct seq_file *sf, void *v)
688EXPORT_SYMBOL_GPL(blkg_print_stat_ios_recursive); 674EXPORT_SYMBOL_GPL(blkg_print_stat_ios_recursive);
689 675
690/** 676/**
691 * blkg_stat_recursive_sum - collect hierarchical blkg_stat
692 * @blkg: blkg of interest
693 * @pol: blkcg_policy which contains the blkg_stat
694 * @off: offset to the blkg_stat in blkg_policy_data or @blkg
695 *
696 * Collect the blkg_stat specified by @blkg, @pol and @off and all its
697 * online descendants and their aux counts. The caller must be holding the
698 * queue lock for online tests.
699 *
700 * If @pol is NULL, blkg_stat is at @off bytes into @blkg; otherwise, it is
701 * at @off bytes into @blkg's blkg_policy_data of the policy.
702 */
703u64 blkg_stat_recursive_sum(struct blkcg_gq *blkg,
704 struct blkcg_policy *pol, int off)
705{
706 struct blkcg_gq *pos_blkg;
707 struct cgroup_subsys_state *pos_css;
708 u64 sum = 0;
709
710 lockdep_assert_held(&blkg->q->queue_lock);
711
712 rcu_read_lock();
713 blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) {
714 struct blkg_stat *stat;
715
716 if (!pos_blkg->online)
717 continue;
718
719 if (pol)
720 stat = (void *)blkg_to_pd(pos_blkg, pol) + off;
721 else
722 stat = (void *)blkg + off;
723
724 sum += blkg_stat_read(stat) + atomic64_read(&stat->aux_cnt);
725 }
726 rcu_read_unlock();
727
728 return sum;
729}
730EXPORT_SYMBOL_GPL(blkg_stat_recursive_sum);
731
732/**
733 * blkg_rwstat_recursive_sum - collect hierarchical blkg_rwstat 677 * blkg_rwstat_recursive_sum - collect hierarchical blkg_rwstat
734 * @blkg: blkg of interest 678 * @blkg: blkg of interest
735 * @pol: blkcg_policy which contains the blkg_rwstat 679 * @pol: blkcg_policy which contains the blkg_rwstat