cgroup: implement cgroup_subsys->depends_on
[firefly-linux-kernel-4.4.55.git] / include / linux / cgroup.h
index 5287f931680a641eb81193e0a1970f96e3e01443..28853e771f3b24fd0316b7b0984b6aa77098eca4 100644 (file)
@@ -642,6 +642,7 @@ struct cgroup_subsys {
        int (*css_online)(struct cgroup_subsys_state *css);
        void (*css_offline)(struct cgroup_subsys_state *css);
        void (*css_free)(struct cgroup_subsys_state *css);
+       void (*css_reset)(struct cgroup_subsys_state *css);
 
        int (*can_attach)(struct cgroup_subsys_state *css,
                          struct cgroup_taskset *tset);
@@ -692,6 +693,15 @@ struct cgroup_subsys {
 
        /* base cftypes, automatically registered with subsys itself */
        struct cftype *base_cftypes;
+
+       /*
+        * A subsystem may depend on other subsystems.  When such subsystem
+        * is enabled on a cgroup, the depended-upon subsystems are enabled
+        * together if available.  Subsystems enabled due to dependency are
+        * not visible to userland until explicitly enabled.  The following
+        * specifies the mask of subsystems that this one depends on.
+        */
+       unsigned int depends_on;
 };
 
 #define SUBSYS(_x) extern struct cgroup_subsys _x ## _cgrp_subsys;