cgroup: remove cgroup->actual_subsys_mask
cgroup curiously has two subsystem masks, ->subsys_mask and ->actual_subsys_mask. The latter only exists because the new target subsys_mask is passed into rebind_subsystems() via @root>subsys_mask. rebind_subsystems() needs to know what the current mask is to decide how to reach the target mask so ->actual_subsys_mask is used as the temp location to remember the current state. Adding a temporary field to a permanent data structure is rather silly and can be misleading. Update rebind_subsystems() to take @added_mask and @removed_mask instead and remove @root->actual_subsys_mask. This patch shouldn't introduce any behavior changes. v2: Comment and description updated as suggested by Li. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
This commit is contained in:
@@ -286,18 +286,12 @@ enum {
|
||||
struct cgroupfs_root {
|
||||
struct super_block *sb;
|
||||
|
||||
/*
|
||||
* The bitmask of subsystems intended to be attached to this
|
||||
* hierarchy
|
||||
*/
|
||||
/* The bitmask of subsystems attached to this hierarchy */
|
||||
unsigned long subsys_mask;
|
||||
|
||||
/* Unique id for this hierarchy. */
|
||||
int hierarchy_id;
|
||||
|
||||
/* The bitmask of subsystems currently attached to this hierarchy */
|
||||
unsigned long actual_subsys_mask;
|
||||
|
||||
/* A list running through the attached subsystems */
|
||||
struct list_head subsys_list;
|
||||
|
||||
|
Reference in New Issue
Block a user