Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309243
b: refs/heads/master
c: 627f29f
h: refs/heads/master
i:
  309241: ad16bad
  309239: 142ee15
v: v3
  • Loading branch information
Tejun Heo committed Apr 1, 2012
1 parent eb6d8eb commit 76415b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 29 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: d3d32e69fa368e131b25ee68806aa3fd3916cec1
refs/heads/master: 627f29f48158c3088cc55a25d8650cae455ff63b
35 changes: 7 additions & 28 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,9 @@ static int blkiocg_file_read(struct cgroup *cgrp, struct cftype *cft,
return 0;
}

static int blkio_weight_write(struct blkio_cgroup *blkcg, int plid, u64 val)
static int blkcg_set_weight(struct cgroup *cgrp, struct cftype *cft, u64 val)
{
struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgrp);
struct blkio_group *blkg;
struct hlist_node *n;

Expand All @@ -1220,10 +1221,11 @@ static int blkio_weight_write(struct blkio_cgroup *blkcg, int plid, u64 val)
blkcg->weight = (unsigned int)val;

hlist_for_each_entry(blkg, n, &blkcg->blkg_list, blkcg_node) {
struct blkg_policy_data *pd = blkg->pd[plid];
struct blkg_policy_data *pd = blkg->pd[BLKIO_POLICY_PROP];

if (!pd->conf.weight)
blkio_update_group_weight(blkg, plid, blkcg->weight);
if (pd && !pd->conf.weight)
blkio_update_group_weight(blkg, BLKIO_POLICY_PROP,
blkcg->weight);
}

spin_unlock_irq(&blkcg->lock);
Expand Down Expand Up @@ -1251,29 +1253,6 @@ static u64 blkiocg_file_read_u64 (struct cgroup *cgrp, struct cftype *cft) {
return 0;
}

static int
blkiocg_file_write_u64(struct cgroup *cgrp, struct cftype *cft, u64 val)
{
struct blkio_cgroup *blkcg;
enum blkio_policy_id plid = BLKIOFILE_POLICY(cft->private);
int name = BLKIOFILE_ATTR(cft->private);

blkcg = cgroup_to_blkio_cgroup(cgrp);

switch(plid) {
case BLKIO_POLICY_PROP:
switch(name) {
case BLKIO_PROP_weight:
return blkio_weight_write(blkcg, plid, val);
}
break;
default:
BUG();
}

return 0;
}

struct cftype blkio_files[] = {
{
.name = "weight_device",
Expand All @@ -1288,7 +1267,7 @@ struct cftype blkio_files[] = {
.private = BLKIOFILE_PRIVATE(BLKIO_POLICY_PROP,
BLKIO_PROP_weight),
.read_u64 = blkiocg_file_read_u64,
.write_u64 = blkiocg_file_write_u64,
.write_u64 = blkcg_set_weight,
},
{
.name = "time",
Expand Down

0 comments on commit 76415b8

Please sign in to comment.