userfaultfd: linux/userfaultfd_k.h
[linux-2.6-block.git] / include / linux / cgroup-defs.h
index 93755a6292995cd20ec5a3df0528f9a72fbf5616..4d8fcf2187dcaa822b8f629655e83d667a9913ac 100644 (file)
@@ -34,12 +34,17 @@ struct seq_file;
 
 /* define the enumeration of all cgroup subsystems */
 #define SUBSYS(_x) _x ## _cgrp_id,
+#define SUBSYS_TAG(_t) CGROUP_ ## _t, \
+       __unused_tag_ ## _t = CGROUP_ ## _t - 1,
 enum cgroup_subsys_id {
 #include <linux/cgroup_subsys.h>
        CGROUP_SUBSYS_COUNT,
 };
+#undef SUBSYS_TAG
 #undef SUBSYS
 
+#define CGROUP_CANFORK_COUNT (CGROUP_CANFORK_END - CGROUP_CANFORK_START)
+
 /* bits in struct cgroup_subsys_state flags field */
 enum {
        CSS_NO_REF      = (1 << 0), /* no reference counting for this css */
@@ -318,7 +323,7 @@ struct cftype {
         * end of cftype array.
         */
        char name[MAX_CFTYPE_NAME];
-       int private;
+       unsigned long private;
        /*
         * If not 0, file mode is set to this value, otherwise it will
         * be figured out automatically
@@ -406,7 +411,9 @@ struct cgroup_subsys {
                              struct cgroup_taskset *tset);
        void (*attach)(struct cgroup_subsys_state *css,
                       struct cgroup_taskset *tset);
-       void (*fork)(struct task_struct *task);
+       int (*can_fork)(struct task_struct *task, void **priv_p);
+       void (*cancel_fork)(struct task_struct *task, void *priv);
+       void (*fork)(struct task_struct *task, void *priv);
        void (*exit)(struct cgroup_subsys_state *css,
                     struct cgroup_subsys_state *old_css,
                     struct task_struct *task);
@@ -434,6 +441,9 @@ struct cgroup_subsys {
        int id;
        const char *name;
 
+       /* optional, initialized automatically during boot if not set */
+       const char *legacy_name;
+
        /* link to parent, protected by cgroup_lock() */
        struct cgroup_root *root;
 
@@ -491,6 +501,7 @@ static inline void cgroup_threadgroup_change_end(struct task_struct *tsk)
 
 #else  /* CONFIG_CGROUPS */
 
+#define CGROUP_CANFORK_COUNT 0
 #define CGROUP_SUBSYS_COUNT 0
 
 static inline void cgroup_threadgroup_change_begin(struct task_struct *tsk) {}