diff options
author | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:45 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-04-01 17:38:45 -0400 |
commit | 5bc4afb1ec6aa562fac4d9aba34d957ee42f5813 (patch) | |
tree | dfef1de2dcb71beab3150ffecf6ae564d326ffba /block/blk-cgroup.c | |
parent | d366e7ec41882791c970dfb7c67b737be8c3a174 (diff) |
blkcg: drop BLKCG_STAT_{PRIV|POL|OFF} macros
Now that all stat handling code lives in policy implementations,
there's no need to encode policy ID in cft->private.
* Export blkcg_prfill_[rw]stat() from blkcg, remove
blkcg_print_[rw]stat(), and implement cfqg_print_[rw]stat() which
use hard-code BLKIO_POLICY_PROP.
* Use cft->private for offset of the target field directly and drop
BLKCG_STAT_{PRIV|POL|OFF}().
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r-- | block/blk-cgroup.c | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 7de19d7954c7..9449c383b7ba 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -430,43 +430,35 @@ u64 __blkg_prfill_rwstat(struct seq_file *sf, void *pdata, | |||
430 | return v; | 430 | return v; |
431 | } | 431 | } |
432 | 432 | ||
433 | static u64 blkg_prfill_stat(struct seq_file *sf, void *pdata, int off) | 433 | /** |
434 | * blkg_prfill_stat - prfill callback for blkg_stat | ||
435 | * @sf: seq_file to print to | ||
436 | * @pdata: policy private data of interest | ||
437 | * @off: offset to the blkg_stat in @pdata | ||
438 | * | ||
439 | * prfill callback for printing a blkg_stat. | ||
440 | */ | ||
441 | u64 blkg_prfill_stat(struct seq_file *sf, void *pdata, int off) | ||
434 | { | 442 | { |
435 | return __blkg_prfill_u64(sf, pdata, blkg_stat_read(pdata + off)); | 443 | return __blkg_prfill_u64(sf, pdata, blkg_stat_read(pdata + off)); |
436 | } | 444 | } |
445 | EXPORT_SYMBOL_GPL(blkg_prfill_stat); | ||
437 | 446 | ||
438 | static u64 blkg_prfill_rwstat(struct seq_file *sf, void *pdata, int off) | 447 | /** |
448 | * blkg_prfill_rwstat - prfill callback for blkg_rwstat | ||
449 | * @sf: seq_file to print to | ||
450 | * @pdata: policy private data of interest | ||
451 | * @off: offset to the blkg_rwstat in @pdata | ||
452 | * | ||
453 | * prfill callback for printing a blkg_rwstat. | ||
454 | */ | ||
455 | u64 blkg_prfill_rwstat(struct seq_file *sf, void *pdata, int off) | ||
439 | { | 456 | { |
440 | struct blkg_rwstat rwstat = blkg_rwstat_read(pdata + off); | 457 | struct blkg_rwstat rwstat = blkg_rwstat_read(pdata + off); |
441 | 458 | ||
442 | return __blkg_prfill_rwstat(sf, pdata, &rwstat); | 459 | return __blkg_prfill_rwstat(sf, pdata, &rwstat); |
443 | } | 460 | } |
444 | 461 | EXPORT_SYMBOL_GPL(blkg_prfill_rwstat); | |
445 | /* print blkg_stat specified by BLKCG_STAT_PRIV() */ | ||
446 | int blkcg_print_stat(struct cgroup *cgrp, struct cftype *cft, | ||
447 | struct seq_file *sf) | ||
448 | { | ||
449 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgrp); | ||
450 | |||
451 | blkcg_print_blkgs(sf, blkcg, blkg_prfill_stat, | ||
452 | BLKCG_STAT_POL(cft->private), | ||
453 | BLKCG_STAT_OFF(cft->private), false); | ||
454 | return 0; | ||
455 | } | ||
456 | EXPORT_SYMBOL_GPL(blkcg_print_stat); | ||
457 | |||
458 | /* print blkg_rwstat specified by BLKCG_STAT_PRIV() */ | ||
459 | int blkcg_print_rwstat(struct cgroup *cgrp, struct cftype *cft, | ||
460 | struct seq_file *sf) | ||
461 | { | ||
462 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgrp); | ||
463 | |||
464 | blkcg_print_blkgs(sf, blkcg, blkg_prfill_rwstat, | ||
465 | BLKCG_STAT_POL(cft->private), | ||
466 | BLKCG_STAT_OFF(cft->private), true); | ||
467 | return 0; | ||
468 | } | ||
469 | EXPORT_SYMBOL_GPL(blkcg_print_rwstat); | ||
470 | 462 | ||
471 | /** | 463 | /** |
472 | * blkg_conf_prep - parse and prepare for per-blkg config update | 464 | * blkg_conf_prep - parse and prepare for per-blkg config update |