Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309264
b: refs/heads/master
c: da8b066
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Apr 20, 2012
1 parent 2918dca commit 42febac
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 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: 8bd435b30ecacb69bbb8b2d3e251f770b807c5b2
refs/heads/master: da8b066262e12d1d0a3b1e6d3486e500169bf730
17 changes: 10 additions & 7 deletions trunk/block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,17 +464,19 @@ EXPORT_SYMBOL_GPL(blkg_prfill_rwstat);
/**
* blkg_conf_prep - parse and prepare for per-blkg config update
* @blkcg: target block cgroup
* @pol: target policy
* @input: input string
* @ctx: blkg_conf_ctx to be filled
*
* Parse per-blkg config update from @input and initialize @ctx with the
* result. @ctx->blkg points to the blkg to be updated and @ctx->v the new
* value. This function returns with RCU read locked and must be paired
* with blkg_conf_finish().
* value. This function returns with RCU read lock and queue lock held and
* must be paired with blkg_conf_finish().
*/
int blkg_conf_prep(struct blkio_cgroup *blkcg, const char *input,
int blkg_conf_prep(struct blkio_cgroup *blkcg,
const struct blkio_policy_type *pol, const char *input,
struct blkg_conf_ctx *ctx)
__acquires(rcu)
__acquires(rcu) __acquires(disk->queue->queue_lock)
{
struct gendisk *disk;
struct blkio_group *blkg;
Expand All @@ -490,14 +492,14 @@ int blkg_conf_prep(struct blkio_cgroup *blkcg, const char *input,
return -EINVAL;

rcu_read_lock();

spin_lock_irq(disk->queue->queue_lock);

blkg = blkg_lookup_create(blkcg, disk->queue, false);
spin_unlock_irq(disk->queue->queue_lock);

if (IS_ERR(blkg)) {
ret = PTR_ERR(blkg);
rcu_read_unlock();
spin_unlock_irq(disk->queue->queue_lock);
put_disk(disk);
/*
* If queue was bypassing, we should retry. Do so after a
Expand Down Expand Up @@ -527,8 +529,9 @@ EXPORT_SYMBOL_GPL(blkg_conf_prep);
* with blkg_conf_prep().
*/
void blkg_conf_finish(struct blkg_conf_ctx *ctx)
__releases(rcu)
__releases(ctx->disk->queue->queue_lock) __releases(rcu)
{
spin_unlock_irq(ctx->disk->queue->queue_lock);
rcu_read_unlock();
put_disk(ctx->disk);
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/block/blk-cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ struct blkg_conf_ctx {
u64 v;
};

int blkg_conf_prep(struct blkio_cgroup *blkcg, const char *input,
int blkg_conf_prep(struct blkio_cgroup *blkcg,
const struct blkio_policy_type *pol, const char *input,
struct blkg_conf_ctx *ctx);
void blkg_conf_finish(struct blkg_conf_ctx *ctx);

Expand Down
2 changes: 1 addition & 1 deletion trunk/block/blk-throttle.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ static int tg_set_conf(struct cgroup *cgrp, struct cftype *cft, const char *buf,
struct throtl_grp *tg;
int ret;

ret = blkg_conf_prep(blkcg, buf, &ctx);
ret = blkg_conf_prep(blkcg, &blkio_policy_throtl, buf, &ctx);
if (ret)
return ret;

Expand Down
2 changes: 1 addition & 1 deletion trunk/block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ static int cfqg_set_weight_device(struct cgroup *cgrp, struct cftype *cft,
struct cfq_group *cfqg;
int ret;

ret = blkg_conf_prep(blkcg, buf, &ctx);
ret = blkg_conf_prep(blkcg, &blkio_policy_cfq, buf, &ctx);
if (ret)
return ret;

Expand Down

0 comments on commit 42febac

Please sign in to comment.