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/path_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/path_group.c')
-rw-r--r-- | security/tomoyo/path_group.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/security/tomoyo/path_group.c b/security/tomoyo/path_group.c index bce2524402fa..44e8a5b1ca67 100644 --- a/security/tomoyo/path_group.c +++ b/security/tomoyo/path_group.c @@ -6,8 +6,6 @@ #include <linux/slab.h> #include "common.h" -/* The list for "struct tomoyo_path_group". */ -LIST_HEAD(tomoyo_path_group_list); /** * tomoyo_get_group - Allocate memory for "struct tomoyo_path_group". @@ -30,7 +28,8 @@ struct tomoyo_group *tomoyo_get_path_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_path_group_list, list) { + list_for_each_entry_rcu(group, &tomoyo_group_list[TOMOYO_PATH_GROUP], + list) { if (saved_group_name != group->group_name) continue; atomic_inc(&group->users); @@ -42,7 +41,8 @@ struct tomoyo_group *tomoyo_get_path_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_path_group_list); + list_add_tail_rcu(&entry->list, + &tomoyo_group_list[TOMOYO_PATH_GROUP]); group = entry; entry = NULL; error = 0; @@ -107,7 +107,8 @@ bool tomoyo_read_path_group_policy(struct tomoyo_io_buffer *head) { struct list_head *gpos; struct list_head *mpos; - list_for_each_cookie(gpos, head->read_var1, &tomoyo_path_group_list) { + list_for_each_cookie(gpos, head->read_var1, + &tomoyo_group_list[TOMOYO_PATH_GROUP]) { struct tomoyo_group *group; group = list_entry(gpos, struct tomoyo_group, list); list_for_each_cookie(mpos, head->read_var2, |