aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-04-01 17:38:44 -0400
committerTejun Heo <tj@kernel.org>2012-04-01 17:38:44 -0400
commitd366e7ec41882791c970dfb7c67b737be8c3a174 (patch)
tree78d3c73d90276b797e1553c004272af869a30075 /block/blk-cgroup.c
parentaf133ceb261033eb43c03d161a991c3b772e8c56 (diff)
blkcg: pass around pd->pdata instead of pd itself in prfill functions
Now that all conf and stat fields are moved into policy specific blkio_policy_data->pdata areas, there's no reason to use blkio_policy_data itself in prfill functions. Pass around @pd->pdata instead of @pd. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index c0e239b8455e..7de19d7954c7 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -359,7 +359,7 @@ static const char *blkg_dev_name(struct blkio_group *blkg)
359 * cftype->read_seq_string method. 359 * cftype->read_seq_string method.
360 */ 360 */
361void blkcg_print_blkgs(struct seq_file *sf, struct blkio_cgroup *blkcg, 361void blkcg_print_blkgs(struct seq_file *sf, struct blkio_cgroup *blkcg,
362 u64 (*prfill)(struct seq_file *, struct blkg_policy_data *, int), 362 u64 (*prfill)(struct seq_file *, void *, int),
363 int pol, int data, bool show_total) 363 int pol, int data, bool show_total)
364{ 364{
365 struct blkio_group *blkg; 365 struct blkio_group *blkg;
@@ -369,7 +369,7 @@ void blkcg_print_blkgs(struct seq_file *sf, struct blkio_cgroup *blkcg,
369 spin_lock_irq(&blkcg->lock); 369 spin_lock_irq(&blkcg->lock);
370 hlist_for_each_entry(blkg, n, &blkcg->blkg_list, blkcg_node) 370 hlist_for_each_entry(blkg, n, &blkcg->blkg_list, blkcg_node)
371 if (blkg->pd[pol]) 371 if (blkg->pd[pol])
372 total += prfill(sf, blkg->pd[pol], data); 372 total += prfill(sf, blkg->pd[pol]->pdata, data);
373 spin_unlock_irq(&blkcg->lock); 373 spin_unlock_irq(&blkcg->lock);
374 374
375 if (show_total) 375 if (show_total)
@@ -380,14 +380,14 @@ EXPORT_SYMBOL_GPL(blkcg_print_blkgs);
380/** 380/**
381 * __blkg_prfill_u64 - prfill helper for a single u64 value 381 * __blkg_prfill_u64 - prfill helper for a single u64 value
382 * @sf: seq_file to print to 382 * @sf: seq_file to print to
383 * @pd: policy data of interest 383 * @pdata: policy private data of interest
384 * @v: value to print 384 * @v: value to print
385 * 385 *
386 * Print @v to @sf for the device assocaited with @pd. 386 * Print @v to @sf for the device assocaited with @pdata.
387 */ 387 */
388u64 __blkg_prfill_u64(struct seq_file *sf, struct blkg_policy_data *pd, u64 v) 388u64 __blkg_prfill_u64(struct seq_file *sf, void *pdata, u64 v)
389{ 389{
390 const char *dname = blkg_dev_name(pd->blkg); 390 const char *dname = blkg_dev_name(pdata_to_blkg(pdata));
391 391
392 if (!dname) 392 if (!dname)
393 return 0; 393 return 0;
@@ -400,12 +400,12 @@ EXPORT_SYMBOL_GPL(__blkg_prfill_u64);
400/** 400/**
401 * __blkg_prfill_rwstat - prfill helper for a blkg_rwstat 401 * __blkg_prfill_rwstat - prfill helper for a blkg_rwstat
402 * @sf: seq_file to print to 402 * @sf: seq_file to print to
403 * @pd: policy data of interest 403 * @pdata: policy private data of interest
404 * @rwstat: rwstat to print 404 * @rwstat: rwstat to print
405 * 405 *
406 * Print @rwstat to @sf for the device assocaited with @pd. 406 * Print @rwstat to @sf for the device assocaited with @pdata.
407 */ 407 */
408u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd, 408u64 __blkg_prfill_rwstat(struct seq_file *sf, void *pdata,
409 const struct blkg_rwstat *rwstat) 409 const struct blkg_rwstat *rwstat)
410{ 410{
411 static const char *rwstr[] = { 411 static const char *rwstr[] = {
@@ -414,7 +414,7 @@ u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
414 [BLKG_RWSTAT_SYNC] = "Sync", 414 [BLKG_RWSTAT_SYNC] = "Sync",
415 [BLKG_RWSTAT_ASYNC] = "Async", 415 [BLKG_RWSTAT_ASYNC] = "Async",
416 }; 416 };
417 const char *dname = blkg_dev_name(pd->blkg); 417 const char *dname = blkg_dev_name(pdata_to_blkg(pdata));
418 u64 v; 418 u64 v;
419 int i; 419 int i;
420 420
@@ -430,19 +430,16 @@ u64 __blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd,
430 return v; 430 return v;
431} 431}
432 432
433static u64 blkg_prfill_stat(struct seq_file *sf, struct blkg_policy_data *pd, 433static u64 blkg_prfill_stat(struct seq_file *sf, void *pdata, int off)
434 int off)
435{ 434{
436 return __blkg_prfill_u64(sf, pd, 435 return __blkg_prfill_u64(sf, pdata, blkg_stat_read(pdata + off));
437 blkg_stat_read((void *)pd->pdata + off));
438} 436}
439 437
440static u64 blkg_prfill_rwstat(struct seq_file *sf, struct blkg_policy_data *pd, 438static u64 blkg_prfill_rwstat(struct seq_file *sf, void *pdata, int off)
441 int off)
442{ 439{
443 struct blkg_rwstat rwstat = blkg_rwstat_read((void *)pd->pdata + off); 440 struct blkg_rwstat rwstat = blkg_rwstat_read(pdata + off);
444 441
445 return __blkg_prfill_rwstat(sf, pd, &rwstat); 442 return __blkg_prfill_rwstat(sf, pdata, &rwstat);
446} 443}
447 444
448/* print blkg_stat specified by BLKCG_STAT_PRIV() */ 445/* print blkg_stat specified by BLKCG_STAT_PRIV() */