Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173001
b: refs/heads/master
c: f8d461d
h: refs/heads/master
i:
  172999: eadc2b9
v: v3
  • Loading branch information
Vivek Goyal authored and Jens Axboe committed Dec 3, 2009
1 parent ed3ed8c commit 9c65781
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24610333d578478d354144ab4709a203684afc5f
refs/heads/master: f8d461d692c341add957fb973fb5ee1f62039dc7
7 changes: 7 additions & 0 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "blk-cgroup.h"

extern void cfq_unlink_blkio_group(void *, struct blkio_group *);
extern void cfq_update_blkio_group_weight(struct blkio_group *, unsigned int);

struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };

Expand Down Expand Up @@ -116,12 +117,18 @@ static int
blkiocg_weight_write(struct cgroup *cgroup, struct cftype *cftype, u64 val)
{
struct blkio_cgroup *blkcg;
struct blkio_group *blkg;
struct hlist_node *n;

if (val < BLKIO_WEIGHT_MIN || val > BLKIO_WEIGHT_MAX)
return -EINVAL;

blkcg = cgroup_to_blkio_cgroup(cgroup);
spin_lock_irq(&blkcg->lock);
blkcg->weight = (unsigned int)val;
hlist_for_each_entry(blkg, n, &blkcg->blkg_list, blkcg_node)
cfq_update_blkio_group_weight(blkg, blkcg->weight);
spin_unlock_irq(&blkcg->lock);
return 0;
}

Expand Down
6 changes: 6 additions & 0 deletions trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,12 @@ static inline struct cfq_group *cfqg_of_blkg(struct blkio_group *blkg)
return NULL;
}

void
cfq_update_blkio_group_weight(struct blkio_group *blkg, unsigned int weight)
{
cfqg_of_blkg(blkg)->weight = weight;
}

static struct cfq_group *
cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
{
Expand Down

0 comments on commit 9c65781

Please sign in to comment.