Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309207
b: refs/heads/master
c: 92616b5
h: refs/heads/master
i:
  309205: ba1db9e
  309203: 3d6b0a7
  309199: 841e6bb
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Mar 6, 2012
1 parent dc206ff commit a9e32d5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a4dd281ec66224f802093962d1d903d86b09560
refs/heads/master: 92616b5b3a7c7fa8148df82e7ff6183056f2bfc8
17 changes: 14 additions & 3 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,13 +951,24 @@ static int blkiocg_file_write(struct cgroup *cgrp, struct cftype *cft,
return ret;
}

static const char *blkg_dev_name(struct blkio_group *blkg)
{
/* some drivers (floppy) instantiate a queue w/o disk registered */
if (blkg->q->backing_dev_info.dev)
return dev_name(blkg->q->backing_dev_info.dev);
return NULL;
}

static void blkio_print_group_conf(struct cftype *cft, struct blkio_group *blkg,
struct seq_file *m)
{
const char *dname = dev_name(blkg->q->backing_dev_info.dev);
const char *dname = blkg_dev_name(blkg);
int fileid = BLKIOFILE_ATTR(cft->private);
int rw = WRITE;

if (!dname)
return;

switch (blkg->plid) {
case BLKIO_POLICY_PROP:
if (blkg->conf.weight)
Expand Down Expand Up @@ -1049,9 +1060,9 @@ static int blkio_read_blkg_stats(struct blkio_cgroup *blkcg,

rcu_read_lock();
hlist_for_each_entry_rcu(blkg, n, &blkcg->blkg_list, blkcg_node) {
const char *dname = dev_name(blkg->q->backing_dev_info.dev);
const char *dname = blkg_dev_name(blkg);

if (BLKIOFILE_POLICY(cft->private) != blkg->plid)
if (!dname || BLKIOFILE_POLICY(cft->private) != blkg->plid)
continue;
if (pcpu)
cgroup_total += blkio_get_stat_cpu(blkg, cb, dname,
Expand Down

0 comments on commit a9e32d5

Please sign in to comment.