Skip to content

Commit

Permalink
blkcg: s/CFQ_WEIGHT_*/CFQ_WEIGHT_LEGACY_*/
Browse files Browse the repository at this point in the history
blkcg is gonna switch to cgroup common weight range as defined by
CGROUP_WEIGHT_* on the unified hierarchy.  In preparation, rename
CFQ_WEIGHT_* constants to CFQ_WEIGHT_LEGACY_*.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Aug 18, 2015
1 parent 2ee867d commit 3ecca62
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ static struct kmem_cache *cfq_pool;
#define rb_entry_cfqg(node) rb_entry((node), struct cfq_group, rb_node)

/* blkio-related constants */
#define CFQ_WEIGHT_MIN 10
#define CFQ_WEIGHT_MAX 1000
#define CFQ_WEIGHT_DEFAULT 500
#define CFQ_WEIGHT_LEGACY_MIN 10
#define CFQ_WEIGHT_LEGACY_DFL 500
#define CFQ_WEIGHT_LEGACY_MAX 1000

struct cfq_ttime {
unsigned long last_end_request;
Expand Down Expand Up @@ -1580,11 +1580,11 @@ static void cfq_cpd_init(struct blkcg_policy_data *cpd)
struct cfq_group_data *cgd = cpd_to_cfqgd(cpd);

if (cpd_to_blkcg(cpd) == &blkcg_root) {
cgd->weight = 2 * CFQ_WEIGHT_DEFAULT;
cgd->leaf_weight = 2 * CFQ_WEIGHT_DEFAULT;
cgd->weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
cgd->leaf_weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
} else {
cgd->weight = CFQ_WEIGHT_DEFAULT;
cgd->leaf_weight = CFQ_WEIGHT_DEFAULT;
cgd->weight = CFQ_WEIGHT_LEGACY_DFL;
cgd->leaf_weight = CFQ_WEIGHT_LEGACY_DFL;
}
}

Expand Down Expand Up @@ -1769,7 +1769,7 @@ static ssize_t __cfqg_set_weight_device(struct kernfs_open_file *of,
cfqgd = blkcg_to_cfqgd(blkcg);

ret = -ERANGE;
if (!v || (v >= CFQ_WEIGHT_MIN && v <= CFQ_WEIGHT_MAX)) {
if (!v || (v >= CFQ_WEIGHT_LEGACY_MIN && v <= CFQ_WEIGHT_LEGACY_MAX)) {
if (!is_leaf_weight) {
cfqg->dev_weight = v;
cfqg->new_weight = v ?: cfqgd->weight;
Expand Down Expand Up @@ -1804,7 +1804,7 @@ static int __cfq_set_weight(struct cgroup_subsys_state *css, u64 val,
struct cfq_group_data *cfqgd;
int ret = 0;

if (val < CFQ_WEIGHT_MIN || val > CFQ_WEIGHT_MAX)
if (val < CFQ_WEIGHT_LEGACY_MIN || val > CFQ_WEIGHT_LEGACY_MAX)
return -EINVAL;

spin_lock_irq(&blkcg->lock);
Expand Down Expand Up @@ -4513,8 +4513,8 @@ static int cfq_init_queue(struct request_queue *q, struct elevator_type *e)

cfq_init_cfqg_base(cfqd->root_group);
#endif
cfqd->root_group->weight = 2 * CFQ_WEIGHT_DEFAULT;
cfqd->root_group->leaf_weight = 2 * CFQ_WEIGHT_DEFAULT;
cfqd->root_group->weight = 2 * CFQ_WEIGHT_LEGACY_DFL;
cfqd->root_group->leaf_weight = 2 * CFQ_WEIGHT_LEGACY_DFL;

/*
* Not strictly needed (since RB_ROOT just clears the node and we
Expand Down

0 comments on commit 3ecca62

Please sign in to comment.