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/number_group.c | |
parent | a98aa4debe2728abb3353e35fc5d110dcc0d7f0d (diff) |
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/number_group.c')
-rw-r--r-- | security/tomoyo/number_group.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/security/tomoyo/number_group.c b/security/tomoyo/number_group.c index eca20d6f4e8b..99694153b947 100644 --- a/security/tomoyo/number_group.c +++ b/security/tomoyo/number_group.c @@ -7,9 +7,6 @@ #include <linux/slab.h> #include "common.h" -/* The list for "struct tomoyo_number_group". */ -LIST_HEAD(tomoyo_number_group_list); - /** * tomoyo_get_group - Allocate memory for "struct tomoyo_number_group". * @@ -32,7 +29,8 @@ struct tomoyo_group *tomoyo_get_number_group(const char *group_name) entry = kzalloc(sizeof(*entry), GFP_NOFS); if (mutex_lock_interruptible(&tomoyo_policy_lock)) goto out; - list_for_each_entry_rcu(group, &tomoyo_number_group_list, list) { + list_for_each_entry_rcu(group, &tomoyo_group_list[TOMOYO_NUMBER_GROUP], + list) { if (saved_group_name != group->group_name) continue; atomic_inc(&group->users); @@ -44,7 +42,8 @@ struct tomoyo_group *tomoyo_get_number_group(const char *group_name) entry->group_name = saved_group_name; saved_group_name = NULL; atomic_set(&entry->users, 1); - list_add_tail_rcu(&entry->list, &tomoyo_number_group_list); + list_add_tail_rcu(&entry->list, + &tomoyo_group_list[TOMOYO_NUMBER_GROUP]); group = entry; entry = NULL; error = 0; @@ -110,7 +109,8 @@ bool tomoyo_read_number_group_policy(struct tomoyo_io_buffer *head) { struct list_head *gpos; struct list_head *mpos; - list_for_each_cookie(gpos, head->read_var1, &tomoyo_number_group_list) { + list_for_each_cookie(gpos, head->read_var1, + &tomoyo_group_list[TOMOYO_NUMBER_GROUP]) { struct tomoyo_group *group; const char *name; group = list_entry(gpos, struct tomoyo_group, list); |