Commit 2da8ca82 authored by Tejun Heo's avatar Tejun Heo

cgroup: replace cftype->read_seq_string() with cftype->seq_show()

In preparation of conversion to kernfs, cgroup file handling is
updated so that it can be easily mapped to kernfs.  This patch
replaces cftype->read_seq_string() with cftype->seq_show() which is
not limited to single_open() operation and will map directcly to
kernfs seq_file interface.

The conversions are mechanical.  As ->seq_show() doesn't have @css and
@cft, the functions which make use of them are converted to use
seq_css() and seq_cft() respectively.  In several occassions, e.f. if
it has seq_string in its name, the function name is updated to fit the
new method better.

This patch does not introduce any behavior changes.
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarAristeu Rozanski <arozansk@redhat.com>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.cz>
Acked-by: default avatarDaniel Wagner <daniel.wagner@bmw-carit.de>
Acked-by: default avatarLi Zefan <lizefan@huawei.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
parent 7da11279
...@@ -1303,13 +1303,10 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf, ...@@ -1303,13 +1303,10 @@ static u64 tg_prfill_cpu_rwstat(struct seq_file *sf,
return __blkg_prfill_rwstat(sf, pd, &rwstat); return __blkg_prfill_rwstat(sf, pd, &rwstat);
} }
static int tg_print_cpu_rwstat(struct cgroup_subsys_state *css, static int tg_print_cpu_rwstat(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
struct blkcg *blkcg = css_to_blkcg(css); blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_cpu_rwstat,
&blkcg_policy_throtl, seq_cft(sf)->private, true);
blkcg_print_blkgs(sf, blkcg, tg_prfill_cpu_rwstat, &blkcg_policy_throtl,
cft->private, true);
return 0; return 0;
} }
...@@ -1335,19 +1332,17 @@ static u64 tg_prfill_conf_uint(struct seq_file *sf, struct blkg_policy_data *pd, ...@@ -1335,19 +1332,17 @@ static u64 tg_prfill_conf_uint(struct seq_file *sf, struct blkg_policy_data *pd,
return __blkg_prfill_u64(sf, pd, v); return __blkg_prfill_u64(sf, pd, v);
} }
static int tg_print_conf_u64(struct cgroup_subsys_state *css, static int tg_print_conf_u64(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_u64, blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_u64,
&blkcg_policy_throtl, cft->private, false); &blkcg_policy_throtl, seq_cft(sf)->private, false);
return 0; return 0;
} }
static int tg_print_conf_uint(struct cgroup_subsys_state *css, static int tg_print_conf_uint(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
blkcg_print_blkgs(sf, css_to_blkcg(css), tg_prfill_conf_uint, blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), tg_prfill_conf_uint,
&blkcg_policy_throtl, cft->private, false); &blkcg_policy_throtl, seq_cft(sf)->private, false);
return 0; return 0;
} }
...@@ -1428,40 +1423,40 @@ static struct cftype throtl_files[] = { ...@@ -1428,40 +1423,40 @@ static struct cftype throtl_files[] = {
{ {
.name = "throttle.read_bps_device", .name = "throttle.read_bps_device",
.private = offsetof(struct throtl_grp, bps[READ]), .private = offsetof(struct throtl_grp, bps[READ]),
.read_seq_string = tg_print_conf_u64, .seq_show = tg_print_conf_u64,
.write_string = tg_set_conf_u64, .write_string = tg_set_conf_u64,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "throttle.write_bps_device", .name = "throttle.write_bps_device",
.private = offsetof(struct throtl_grp, bps[WRITE]), .private = offsetof(struct throtl_grp, bps[WRITE]),
.read_seq_string = tg_print_conf_u64, .seq_show = tg_print_conf_u64,
.write_string = tg_set_conf_u64, .write_string = tg_set_conf_u64,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "throttle.read_iops_device", .name = "throttle.read_iops_device",
.private = offsetof(struct throtl_grp, iops[READ]), .private = offsetof(struct throtl_grp, iops[READ]),
.read_seq_string = tg_print_conf_uint, .seq_show = tg_print_conf_uint,
.write_string = tg_set_conf_uint, .write_string = tg_set_conf_uint,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "throttle.write_iops_device", .name = "throttle.write_iops_device",
.private = offsetof(struct throtl_grp, iops[WRITE]), .private = offsetof(struct throtl_grp, iops[WRITE]),
.read_seq_string = tg_print_conf_uint, .seq_show = tg_print_conf_uint,
.write_string = tg_set_conf_uint, .write_string = tg_set_conf_uint,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "throttle.io_service_bytes", .name = "throttle.io_service_bytes",
.private = offsetof(struct tg_stats_cpu, service_bytes), .private = offsetof(struct tg_stats_cpu, service_bytes),
.read_seq_string = tg_print_cpu_rwstat, .seq_show = tg_print_cpu_rwstat,
}, },
{ {
.name = "throttle.io_serviced", .name = "throttle.io_serviced",
.private = offsetof(struct tg_stats_cpu, serviced), .private = offsetof(struct tg_stats_cpu, serviced),
.read_seq_string = tg_print_cpu_rwstat, .seq_show = tg_print_cpu_rwstat,
}, },
{ } /* terminate */ { } /* terminate */
}; };
......
...@@ -1632,11 +1632,11 @@ static u64 cfqg_prfill_weight_device(struct seq_file *sf, ...@@ -1632,11 +1632,11 @@ static u64 cfqg_prfill_weight_device(struct seq_file *sf,
return __blkg_prfill_u64(sf, pd, cfqg->dev_weight); return __blkg_prfill_u64(sf, pd, cfqg->dev_weight);
} }
static int cfqg_print_weight_device(struct cgroup_subsys_state *css, static int cfqg_print_weight_device(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
blkcg_print_blkgs(sf, css_to_blkcg(css), cfqg_prfill_weight_device, blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
&blkcg_policy_cfq, 0, false); cfqg_prfill_weight_device, &blkcg_policy_cfq,
0, false);
return 0; return 0;
} }
...@@ -1650,26 +1650,23 @@ static u64 cfqg_prfill_leaf_weight_device(struct seq_file *sf, ...@@ -1650,26 +1650,23 @@ static u64 cfqg_prfill_leaf_weight_device(struct seq_file *sf,
return __blkg_prfill_u64(sf, pd, cfqg->dev_leaf_weight); return __blkg_prfill_u64(sf, pd, cfqg->dev_leaf_weight);
} }
static int cfqg_print_leaf_weight_device(struct cgroup_subsys_state *css, static int cfqg_print_leaf_weight_device(struct seq_file *sf, void *v)
struct cftype *cft,
struct seq_file *sf)
{ {
blkcg_print_blkgs(sf, css_to_blkcg(css), cfqg_prfill_leaf_weight_device, blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
&blkcg_policy_cfq, 0, false); cfqg_prfill_leaf_weight_device, &blkcg_policy_cfq,
0, false);
return 0; return 0;
} }
static int cfq_print_weight(struct cgroup_subsys_state *css, struct cftype *cft, static int cfq_print_weight(struct seq_file *sf, void *v)
struct seq_file *sf)
{ {
seq_printf(sf, "%u\n", css_to_blkcg(css)->cfq_weight); seq_printf(sf, "%u\n", css_to_blkcg(seq_css(sf))->cfq_weight);
return 0; return 0;
} }
static int cfq_print_leaf_weight(struct cgroup_subsys_state *css, static int cfq_print_leaf_weight(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
seq_printf(sf, "%u\n", css_to_blkcg(css)->cfq_leaf_weight); seq_printf(sf, "%u\n", css_to_blkcg(seq_css(sf))->cfq_leaf_weight);
return 0; return 0;
} }
...@@ -1762,23 +1759,17 @@ static int cfq_set_leaf_weight(struct cgroup_subsys_state *css, ...@@ -1762,23 +1759,17 @@ static int cfq_set_leaf_weight(struct cgroup_subsys_state *css,
return __cfq_set_weight(css, cft, val, true); return __cfq_set_weight(css, cft, val, true);
} }
static int cfqg_print_stat(struct cgroup_subsys_state *css, struct cftype *cft, static int cfqg_print_stat(struct seq_file *sf, void *v)
struct seq_file *sf)
{ {
struct blkcg *blkcg = css_to_blkcg(css); blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_stat,
&blkcg_policy_cfq, seq_cft(sf)->private, false);
blkcg_print_blkgs(sf, blkcg, blkg_prfill_stat, &blkcg_policy_cfq,
cft->private, false);
return 0; return 0;
} }
static int cfqg_print_rwstat(struct cgroup_subsys_state *css, static int cfqg_print_rwstat(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
struct blkcg *blkcg = css_to_blkcg(css); blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)), blkg_prfill_rwstat,
&blkcg_policy_cfq, seq_cft(sf)->private, true);
blkcg_print_blkgs(sf, blkcg, blkg_prfill_rwstat, &blkcg_policy_cfq,
cft->private, true);
return 0; return 0;
} }
...@@ -1798,23 +1789,19 @@ static u64 cfqg_prfill_rwstat_recursive(struct seq_file *sf, ...@@ -1798,23 +1789,19 @@ static u64 cfqg_prfill_rwstat_recursive(struct seq_file *sf,
return __blkg_prfill_rwstat(sf, pd, &sum); return __blkg_prfill_rwstat(sf, pd, &sum);
} }
static int cfqg_print_stat_recursive(struct cgroup_subsys_state *css, static int cfqg_print_stat_recursive(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
struct blkcg *blkcg = css_to_blkcg(css); blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
cfqg_prfill_stat_recursive, &blkcg_policy_cfq,
blkcg_print_blkgs(sf, blkcg, cfqg_prfill_stat_recursive, seq_cft(sf)->private, false);
&blkcg_policy_cfq, cft->private, false);
return 0; return 0;
} }
static int cfqg_print_rwstat_recursive(struct cgroup_subsys_state *css, static int cfqg_print_rwstat_recursive(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
struct blkcg *blkcg = css_to_blkcg(css); blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
cfqg_prfill_rwstat_recursive, &blkcg_policy_cfq,
blkcg_print_blkgs(sf, blkcg, cfqg_prfill_rwstat_recursive, seq_cft(sf)->private, true);
&blkcg_policy_cfq, cft->private, true);
return 0; return 0;
} }
...@@ -1835,13 +1822,11 @@ static u64 cfqg_prfill_avg_queue_size(struct seq_file *sf, ...@@ -1835,13 +1822,11 @@ static u64 cfqg_prfill_avg_queue_size(struct seq_file *sf,
} }
/* print avg_queue_size */ /* print avg_queue_size */
static int cfqg_print_avg_queue_size(struct cgroup_subsys_state *css, static int cfqg_print_avg_queue_size(struct seq_file *sf, void *v)
struct cftype *cft, struct seq_file *sf)
{ {
struct blkcg *blkcg = css_to_blkcg(css); blkcg_print_blkgs(sf, css_to_blkcg(seq_css(sf)),
cfqg_prfill_avg_queue_size, &blkcg_policy_cfq,
blkcg_print_blkgs(sf, blkcg, cfqg_prfill_avg_queue_size, 0, false);
&blkcg_policy_cfq, 0, false);
return 0; return 0;
} }
#endif /* CONFIG_DEBUG_BLK_CGROUP */ #endif /* CONFIG_DEBUG_BLK_CGROUP */
...@@ -1851,14 +1836,14 @@ static struct cftype cfq_blkcg_files[] = { ...@@ -1851,14 +1836,14 @@ static struct cftype cfq_blkcg_files[] = {
{ {
.name = "weight_device", .name = "weight_device",
.flags = CFTYPE_ONLY_ON_ROOT, .flags = CFTYPE_ONLY_ON_ROOT,
.read_seq_string = cfqg_print_leaf_weight_device, .seq_show = cfqg_print_leaf_weight_device,
.write_string = cfqg_set_leaf_weight_device, .write_string = cfqg_set_leaf_weight_device,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "weight", .name = "weight",
.flags = CFTYPE_ONLY_ON_ROOT, .flags = CFTYPE_ONLY_ON_ROOT,
.read_seq_string = cfq_print_leaf_weight, .seq_show = cfq_print_leaf_weight,
.write_u64 = cfq_set_leaf_weight, .write_u64 = cfq_set_leaf_weight,
}, },
...@@ -1866,26 +1851,26 @@ static struct cftype cfq_blkcg_files[] = { ...@@ -1866,26 +1851,26 @@ static struct cftype cfq_blkcg_files[] = {
{ {
.name = "weight_device", .name = "weight_device",
.flags = CFTYPE_NOT_ON_ROOT, .flags = CFTYPE_NOT_ON_ROOT,
.read_seq_string = cfqg_print_weight_device, .seq_show = cfqg_print_weight_device,
.write_string = cfqg_set_weight_device, .write_string = cfqg_set_weight_device,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "weight", .name = "weight",
.flags = CFTYPE_NOT_ON_ROOT, .flags = CFTYPE_NOT_ON_ROOT,
.read_seq_string = cfq_print_weight, .seq_show = cfq_print_weight,
.write_u64 = cfq_set_weight, .write_u64 = cfq_set_weight,
}, },
{ {
.name = "leaf_weight_device", .name = "leaf_weight_device",
.read_seq_string = cfqg_print_leaf_weight_device, .seq_show = cfqg_print_leaf_weight_device,
.write_string = cfqg_set_leaf_weight_device, .write_string = cfqg_set_leaf_weight_device,
.max_write_len = 256, .max_write_len = 256,
}, },
{ {
.name = "leaf_weight", .name = "leaf_weight",
.read_seq_string = cfq_print_leaf_weight, .seq_show = cfq_print_leaf_weight,
.write_u64 = cfq_set_leaf_weight, .write_u64 = cfq_set_leaf_weight,
}, },
...@@ -1893,114 +1878,114 @@ static struct cftype cfq_blkcg_files[] = { ...@@ -1893,114 +1878,114 @@ static struct cftype cfq_blkcg_files[] = {
{ {
.name = "time", .name = "time",
.private = offsetof(struct cfq_group, stats.time), .private = offsetof(struct cfq_group, stats.time),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
{ {
.name = "sectors", .name = "sectors",
.private = offsetof(struct cfq_group, stats.sectors), .private = offsetof(struct cfq_group, stats.sectors),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
{ {
.name = "io_service_bytes", .name = "io_service_bytes",
.private = offsetof(struct cfq_group, stats.service_bytes), .private = offsetof(struct cfq_group, stats.service_bytes),
.read_seq_string = cfqg_print_rwstat, .seq_show = cfqg_print_rwstat,
}, },
{ {
.name = "io_serviced", .name = "io_serviced",
.private = offsetof(struct cfq_group, stats.serviced), .private = offsetof(struct cfq_group, stats.serviced),
.read_seq_string = cfqg_print_rwstat, .seq_show = cfqg_print_rwstat,
}, },
{ {
.name = "io_service_time", .name = "io_service_time",
.private = offsetof(struct cfq_group, stats.service_time), .private = offsetof(struct cfq_group, stats.service_time),
.read_seq_string = cfqg_print_rwstat, .seq_show = cfqg_print_rwstat,
}, },
{ {
.name = "io_wait_time", .name = "io_wait_time",
.private = offsetof(struct cfq_group, stats.wait_time), .private = offsetof(struct cfq_group, stats.wait_time),
.read_seq_string = cfqg_print_rwstat, .seq_show = cfqg_print_rwstat,
}, },
{ {
.name = "io_merged", .name = "io_merged",
.private = offsetof(struct cfq_group, stats.merged), .private = offsetof(struct cfq_group, stats.merged),
.read_seq_string = cfqg_print_rwstat, .seq_show = cfqg_print_rwstat,
}, },
{ {
.name = "io_queued", .name = "io_queued",
.private = offsetof(struct cfq_group, stats.queued), .private = offsetof(struct cfq_group, stats.queued),
.read_seq_string = cfqg_print_rwstat, .seq_show = cfqg_print_rwstat,
}, },
/* the same statictics which cover the cfqg and its descendants */ /* the same statictics which cover the cfqg and its descendants */
{ {
.name = "time_recursive", .name = "time_recursive",
.private = offsetof(struct cfq_group, stats.time), .private = offsetof(struct cfq_group, stats.time),
.read_seq_string = cfqg_print_stat_recursive, .seq_show = cfqg_print_stat_recursive,
}, },
{ {
.name = "sectors_recursive", .name = "sectors_recursive",
.private = offsetof(struct cfq_group, stats.sectors), .private = offsetof(struct cfq_group, stats.sectors),
.read_seq_string = cfqg_print_stat_recursive, .seq_show = cfqg_print_stat_recursive,
}, },
{ {
.name = "io_service_bytes_recursive", .name = "io_service_bytes_recursive",
.private = offsetof(struct cfq_group, stats.service_bytes), .private = offsetof(struct cfq_group, stats.service_bytes),
.read_seq_string = cfqg_print_rwstat_recursive, .seq_show = cfqg_print_rwstat_recursive,
}, },
{ {
.name = "io_serviced_recursive", .name = "io_serviced_recursive",
.private = offsetof(struct cfq_group, stats.serviced), .private = offsetof(struct cfq_group, stats.serviced),
.read_seq_string = cfqg_print_rwstat_recursive, .seq_show = cfqg_print_rwstat_recursive,
}, },
{ {
.name = "io_service_time_recursive", .name = "io_service_time_recursive",
.private = offsetof(struct cfq_group, stats.service_time), .private = offsetof(struct cfq_group, stats.service_time),
.read_seq_string = cfqg_print_rwstat_recursive, .seq_show = cfqg_print_rwstat_recursive,
}, },
{ {
.name = "io_wait_time_recursive", .name = "io_wait_time_recursive",
.private = offsetof(struct cfq_group, stats.wait_time), .private = offsetof(struct cfq_group, stats.wait_time),
.read_seq_string = cfqg_print_rwstat_recursive, .seq_show = cfqg_print_rwstat_recursive,
}, },
{ {
.name = "io_merged_recursive", .name = "io_merged_recursive",
.private = offsetof(struct cfq_group, stats.merged), .private = offsetof(struct cfq_group, stats.merged),
.read_seq_string = cfqg_print_rwstat_recursive, .seq_show = cfqg_print_rwstat_recursive,
}, },
{ {
.name = "io_queued_recursive", .name = "io_queued_recursive",
.private = offsetof(struct cfq_group, stats.queued), .private = offsetof(struct cfq_group, stats.queued),
.read_seq_string = cfqg_print_rwstat_recursive, .seq_show = cfqg_print_rwstat_recursive,
}, },
#ifdef CONFIG_DEBUG_BLK_CGROUP #ifdef CONFIG_DEBUG_BLK_CGROUP
{ {
.name = "avg_queue_size", .name = "avg_queue_size",
.read_seq_string = cfqg_print_avg_queue_size, .seq_show = cfqg_print_avg_queue_size,
}, },
{ {
.name = "group_wait_time", .name = "group_wait_time",
.private = offsetof(struct cfq_group, stats.group_wait_time), .private = offsetof(struct cfq_group, stats.group_wait_time),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
{ {
.name = "idle_time", .name = "idle_time",
.private = offsetof(struct cfq_group, stats.idle_time), .private = offsetof(struct cfq_group, stats.idle_time),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
{ {
.name = "empty_time", .name = "empty_time",
.private = offsetof(struct cfq_group, stats.empty_time), .private = offsetof(struct cfq_group, stats.empty_time),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
{ {
.name = "dequeue", .name = "dequeue",
.private = offsetof(struct cfq_group, stats.dequeue), .private = offsetof(struct cfq_group, stats.dequeue),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
{ {
.name = "unaccounted_time", .name = "unaccounted_time",
.private = offsetof(struct cfq_group, stats.unaccounted_time), .private = offsetof(struct cfq_group, stats.unaccounted_time),
.read_seq_string = cfqg_print_stat, .seq_show = cfqg_print_stat,
}, },
#endif /* CONFIG_DEBUG_BLK_CGROUP */ #endif /* CONFIG_DEBUG_BLK_CGROUP */
{ } /* terminate */ { } /* terminate */
......
...@@ -444,12 +444,9 @@ struct cftype { ...@@ -444,12 +444,9 @@ struct cftype {
* read_s64() is a signed version of read_u64() * read_s64() is a signed version of read_u64()
*/ */
s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft);
/*
* read_seq_string() is used for outputting a simple sequence /* generic seq_file read interface */
* using seqfile. int (*seq_show)(struct seq_file *sf, void *v);
*/
int (*read_seq_string)(struct cgroup_subsys_state *css,
struct cftype *cft, struct seq_file *m);
/* /*
* write_u64() is a shortcut for the common case of accepting * write_u64() is a shortcut for the common case of accepting
......
...@@ -2212,10 +2212,9 @@ static int cgroup_release_agent_write(struct cgroup_subsys_state *css, ...@@ -2212,10 +2212,9 @@ static int cgroup_release_agent_write(struct cgroup_subsys_state *css,
return 0; return 0;
} }
static int cgroup_release_agent_show(struct cgroup_subsys_state *css, static int cgroup_release_agent_show(struct seq_file *seq, void *v)
struct cftype *cft, struct seq_file *seq)
{ {
struct cgroup *cgrp = css->cgroup; struct cgroup *cgrp = seq_css(seq)->cgroup;
if (!cgroup_lock_live_group(cgrp)) if (!cgroup_lock_live_group(cgrp))
return -ENODEV; return -ENODEV;
...@@ -2225,10 +2224,11 @@ static int cgroup_release_agent_show(struct cgroup_subsys_state *css, ...@@ -2225,10 +2224,11 @@ static int cgroup_release_agent_show(struct cgroup_subsys_state *css,
return 0; return 0;
} }
static int cgroup_sane_behavior_show(struct cgroup_subsys_state *css, static int cgroup_sane_behavior_show(struct seq_file *seq, void *v)
struct cftype *cft, struct seq_file *seq)
{ {
seq_printf(seq, "%d\n", cgroup_sane_behavior(css->cgroup)); struct cgroup *cgrp = seq_css(seq)->cgroup;
seq_printf(seq, "%d\n", cgroup_sane_behavior(cgrp));
return 0; return 0;
} }
...@@ -2291,8 +2291,8 @@ static int cgroup_seqfile_show(struct seq_file *m, void *arg) ...@@ -2291,8 +2291,8 @@ static int cgroup_seqfile_show(struct seq_file *m, void *arg)
struct cftype *cft = seq_cft(m); struct cftype *cft = seq_cft(m);
struct cgroup_subsys_state *css = seq_css(m); struct cgroup_subsys_state *css = seq_css(m);
if (cft->read_seq_string) if (cft->seq_show)
return cft->read_seq_string(css, cft, m); return cft->seq_show(m, arg);
if (cft->read_u64) if (cft->read_u64)
seq_printf(m, "%llu\n", cft->read_u64(css, cft)); seq_printf(m, "%llu\n", cft->read_u64(css, cft));
...@@ -2559,7 +2559,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft) ...@@ -2559,7 +2559,7 @@ static umode_t cgroup_file_mode(const struct cftype *cft)
if (cft->mode) if (cft->mode)
return cft->mode; return cft->mode;
if (cft->read_u64 || cft->read_s64 || cft->read_seq_string) if (cft->read_u64 || cft->read_s64 || cft->seq_show)
mode |= S_IRUGO; mode |= S_IRUGO;
if (cft->write_u64 || cft->write_s64 || cft->write_string || if (cft->write_u64 || cft->write_s64 || cft->write_string ||
...@@ -3874,7 +3874,7 @@ static struct cftype cgroup_base_files[] = { ...@@ -3874,7 +3874,7 @@ static struct cftype cgroup_base_files[] = {
{ {
.name = "cgroup.sane_behavior", .name = "cgroup.sane_behavior",
.flags = CFTYPE_ONLY_ON_ROOT, .flags = CFTYPE_ONLY_ON_ROOT,
.read_seq_string = cgroup_sane_behavior_show, .seq_show = cgroup_sane_behavior_show,
}, },
/* /*
...@@ -3899,7 +3899,7 @@ static struct cftype cgroup_base_files[] = { ...@@ -3899,7 +3899,7 @@ static struct cftype cgroup_base_files[] = {
{ {
.name = "release_agent", .name = "release_agent",
.flags = CFTYPE_INSANE | CFTYPE_ONLY_ON_ROOT, .flags = CFTYPE_INSANE | CFTYPE_ONLY_ON_ROOT,
.read_seq_string = cgroup_release_agent_show,