cgroups: introduce cft->read_seq()

Introduce a read_seq() helper in cftype, which uses seq_file to print out
lists.  Use it in the devices cgroup.  Also split devices.allow into two
files, so now devices.deny and devices.allow are the ones to use to manipulate
the whitelist, while devices.list outputs the cgroup's current whitelist.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Acked-by: Paul Menage <menage@google.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Serge E. Hallyn
2008-04-29 01:00:14 -07:00
committed by Linus Torvalds
parent 28fd5dfc12
commit 29486df325
3 changed files with 38 additions and 57 deletions

View File

@@ -226,6 +226,12 @@ struct cftype {
*/
int (*read_map) (struct cgroup *cont, struct cftype *cft,
struct cgroup_map_cb *cb);
/*
* read_seq_string() is used for outputting a simple sequence
* using seqfile.
*/
int (*read_seq_string) (struct cgroup *cont, struct cftype *cft,
struct seq_file *m);
ssize_t (*write) (struct cgroup *cgrp, struct cftype *cft,
struct file *file,