diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-17 16:53:24 +0900 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 15:34:40 +1000 |
commit | a230f9e7121cbcbfe23bd5a630abf6b53cece555 (patch) | |
tree | a81820f41d57ffd8704aaef4331f696030d7ba77 /security/tomoyo/gc.c | |
parent | a98aa4debe2728abb3353e35fc5d110dcc0d7f0d (diff) | |
download | linux-a230f9e7121cbcbfe23bd5a630abf6b53cece555.tar.bz2 |
TOMOYO: Use array of "struct list_head".
Assign list id and make the lists as array of "struct list_head".
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/gc.c')
-rw-r--r-- | security/tomoyo/gc.c | 41 |
1 files changed, 7 insertions, 34 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c index 446d59f8ae25..414e18bd93c7 100644 --- a/security/tomoyo/gc.c +++ b/security/tomoyo/gc.c @@ -11,24 +11,6 @@ #include <linux/kthread.h> #include <linux/slab.h> -enum tomoyo_policy_id { - TOMOYO_ID_GROUP, - TOMOYO_ID_PATH_GROUP, - TOMOYO_ID_NUMBER_GROUP, - TOMOYO_ID_DOMAIN_INITIALIZER, - TOMOYO_ID_DOMAIN_KEEPER, - TOMOYO_ID_AGGREGATOR, - TOMOYO_ID_ALIAS, - TOMOYO_ID_GLOBALLY_READABLE, - TOMOYO_ID_PATTERN, - TOMOYO_ID_NO_REWRITE, - TOMOYO_ID_MANAGER, - TOMOYO_ID_NAME, - TOMOYO_ID_ACL, - TOMOYO_ID_DOMAIN, - TOMOYO_MAX_POLICY -}; - struct tomoyo_gc_entry { struct list_head list; int type; @@ -226,17 +208,6 @@ static void tomoyo_del_number_group(struct list_head *element) container_of(element, typeof(*member), head.list); } -static struct list_head *tomoyo_policy_list[TOMOYO_MAX_POLICY] = { - [TOMOYO_ID_GLOBALLY_READABLE] = &tomoyo_globally_readable_list, - [TOMOYO_ID_PATTERN] = &tomoyo_pattern_list, - [TOMOYO_ID_NO_REWRITE] = &tomoyo_no_rewrite_list, - [TOMOYO_ID_DOMAIN_INITIALIZER] = &tomoyo_domain_initializer_list, - [TOMOYO_ID_DOMAIN_KEEPER] = &tomoyo_domain_keeper_list, - [TOMOYO_ID_AGGREGATOR] = &tomoyo_aggregator_list, - [TOMOYO_ID_ALIAS] = &tomoyo_alias_list, - [TOMOYO_ID_MANAGER] = &tomoyo_policy_manager_list, -}; - static bool tomoyo_collect_member(struct list_head *member_list, int id) { struct tomoyo_acl_head *member; @@ -267,9 +238,8 @@ static void tomoyo_collect_entry(void) if (mutex_lock_interruptible(&tomoyo_policy_lock)) return; for (i = 0; i < TOMOYO_MAX_POLICY; i++) { - if (tomoyo_policy_list[i]) - if (!tomoyo_collect_member(tomoyo_policy_list[i], i)) - goto unlock; + if (!tomoyo_collect_member(&tomoyo_policy_list[i], i)) + goto unlock; } { struct tomoyo_domain_info *domain; @@ -298,7 +268,9 @@ static void tomoyo_collect_entry(void) } { struct tomoyo_group *group; - list_for_each_entry_rcu(group, &tomoyo_path_group_list, list) { + list_for_each_entry_rcu(group, + &tomoyo_group_list[TOMOYO_PATH_GROUP], + list) { tomoyo_collect_member(&group->member_list, TOMOYO_ID_PATH_GROUP); if (!list_empty(&group->member_list) || @@ -311,7 +283,8 @@ static void tomoyo_collect_entry(void) } { struct tomoyo_group *group; - list_for_each_entry_rcu(group, &tomoyo_number_group_list, + list_for_each_entry_rcu(group, + &tomoyo_group_list[TOMOYO_NUMBER_GROUP], list) { tomoyo_collect_member(&group->member_list, TOMOYO_ID_NUMBER_GROUP); |