aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index aeceb8868981..abc433772e5a 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1549,11 +1549,14 @@ static int cgroup_seqfile_show(struct seq_file *m, void *arg)
1549{ 1549{
1550 struct cgroup_seqfile_state *state = m->private; 1550 struct cgroup_seqfile_state *state = m->private;
1551 struct cftype *cft = state->cft; 1551 struct cftype *cft = state->cft;
1552 struct cgroup_map_cb cb = { 1552 if (cft->read_map) {
1553 .fill = cgroup_map_add, 1553 struct cgroup_map_cb cb = {
1554 .state = m, 1554 .fill = cgroup_map_add,
1555 }; 1555 .state = m,
1556 return cft->read_map(state->cgroup, cft, &cb); 1556 };
1557 return cft->read_map(state->cgroup, cft, &cb);
1558 }
1559 return cft->read_seq_string(state->cgroup, cft, m);
1557} 1560}
1558 1561
1559int cgroup_seqfile_release(struct inode *inode, struct file *file) 1562int cgroup_seqfile_release(struct inode *inode, struct file *file)
@@ -1581,7 +1584,7 @@ static int cgroup_file_open(struct inode *inode, struct file *file)
1581 cft = __d_cft(file->f_dentry); 1584 cft = __d_cft(file->f_dentry);
1582 if (!cft) 1585 if (!cft)
1583 return -ENODEV; 1586 return -ENODEV;
1584 if (cft->read_map) { 1587 if (cft->read_map || cft->read_seq_string) {
1585 struct cgroup_seqfile_state *state = 1588 struct cgroup_seqfile_state *state =
1586 kzalloc(sizeof(*state), GFP_USER); 1589 kzalloc(sizeof(*state), GFP_USER);
1587 if (!state) 1590 if (!state)