x86: change x86_64 smp_call_function_mask to look alike i386
[sfrench/cifs-2.6.git] / kernel / cgroup.c
index d8abe996e009702663d9769714f6428f88aac641..2727f92383596e4a6f7bec5072b1e804a7801916 100644 (file)
@@ -782,7 +782,14 @@ static int parse_cgroupfs_options(char *data,
                if (!*token)
                        return -EINVAL;
                if (!strcmp(token, "all")) {
-                       opts->subsys_bits = (1 << CGROUP_SUBSYS_COUNT) - 1;
+                       /* Add all non-disabled subsystems */
+                       int i;
+                       opts->subsys_bits = 0;
+                       for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
+                               struct cgroup_subsys *ss = subsys[i];
+                               if (!ss->disabled)
+                                       opts->subsys_bits |= 1ul << i;
+                       }
                } else if (!strcmp(token, "noprefix")) {
                        set_bit(ROOT_NOPREFIX, &opts->flags);
                } else if (!strncmp(token, "release_agent=", 14)) {
@@ -800,7 +807,8 @@ static int parse_cgroupfs_options(char *data,
                        for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
                                ss = subsys[i];
                                if (!strcmp(token, ss->name)) {
-                                       set_bit(i, &opts->subsys_bits);
+                                       if (!ss->disabled)
+                                               set_bit(i, &opts->subsys_bits);
                                        break;
                                }
                        }
@@ -2082,7 +2090,7 @@ static int cgroup_tasks_open(struct inode *unused, struct file *file)
 
                kfree(pidarray);
        } else {
-               ctr->buf = 0;
+               ctr->buf = NULL;
                ctr->bufsz = 0;
        }
        file->private_data = ctr;
@@ -2232,7 +2240,6 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
 
        mutex_lock(&cgroup_mutex);
 
-       cgrp->flags = 0;
        INIT_LIST_HEAD(&cgrp->sibling);
        INIT_LIST_HEAD(&cgrp->children);
        INIT_LIST_HEAD(&cgrp->css_sets);
@@ -2242,6 +2249,9 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
        cgrp->root = parent->root;
        cgrp->top_cgroup = parent->top_cgroup;
 
+       if (notify_on_release(parent))
+               set_bit(CGRP_NOTIFY_ON_RELEASE, &cgrp->flags);
+
        for_each_subsys(root, ss) {
                struct cgroup_subsys_state *css = ss->create(ss, cgrp);
                if (IS_ERR(css)) {
@@ -2559,6 +2569,7 @@ static int proc_cgroup_show(struct seq_file *m, void *v)
                /* Skip this hierarchy if it has no active subsystems */
                if (!root->actual_subsys_bits)
                        continue;
+               seq_printf(m, "%lu:", root->subsys_bits);
                for_each_subsys(root, ss)
                        seq_printf(m, "%s%s", count++ ? "," : "", ss->name);
                seq_putc(m, ':');
@@ -2598,13 +2609,13 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 {
        int i;
 
-       seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\n");
+       seq_puts(m, "#subsys_name\thierarchy\tnum_cgroups\tenabled\n");
        mutex_lock(&cgroup_mutex);
        for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
                struct cgroup_subsys *ss = subsys[i];
-               seq_printf(m, "%s\t%lu\t%d\n",
+               seq_printf(m, "%s\t%lu\t%d\t%d\n",
                           ss->name, ss->root->subsys_bits,
-                          ss->root->number_of_cgroups);
+                          ss->root->number_of_cgroups, !ss->disabled);
        }
        mutex_unlock(&cgroup_mutex);
        return 0;
@@ -2612,7 +2623,7 @@ static int proc_cgroupstats_show(struct seq_file *m, void *v)
 
 static int cgroupstats_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, proc_cgroupstats_show, 0);
+       return single_open(file, proc_cgroupstats_show, NULL);
 }
 
 static struct file_operations proc_cgroupstats_operations = {
@@ -3008,3 +3019,27 @@ static void cgroup_release_agent(struct work_struct *work)
        spin_unlock(&release_list_lock);
        mutex_unlock(&cgroup_mutex);
 }
+
+static int __init cgroup_disable(char *str)
+{
+       int i;
+       char *token;
+
+       while ((token = strsep(&str, ",")) != NULL) {
+               if (!*token)
+                       continue;
+
+               for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
+                       struct cgroup_subsys *ss = subsys[i];
+
+                       if (!strcmp(token, ss->name)) {
+                               ss->disabled = 1;
+                               printk(KERN_INFO "Disabling %s control group"
+                                       " subsystem\n", ss->name);
+                               break;
+                       }
+               }
+       }
+       return 1;
+}
+__setup("cgroup_disable=", cgroup_disable);