diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-17 03:53:24 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:34:40 -0400 |
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 @@ | |||
6 | 6 | ||
7 | #include <linux/slab.h> | 7 | #include <linux/slab.h> |
8 | #include "common.h" | 8 | #include "common.h" |
9 | /* The list for "struct tomoyo_path_group". */ | ||
10 | LIST_HEAD(tomoyo_path_group_list); | ||
11 | 9 | ||
12 | /** | 10 | /** |
13 | * tomoyo_get_group - Allocate memory for "struct tomoyo_path_group". | 11 | * 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) | |||
30 | entry = kzalloc(sizeof(*entry), GFP_NOFS); | 28 | entry = kzalloc(sizeof(*entry), GFP_NOFS); |
31 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) | 29 | if (mutex_lock_interruptible(&tomoyo_policy_lock)) |
32 | goto out; | 30 | goto out; |
33 | list_for_each_entry_rcu(group, &tomoyo_path_group_list, list) { | 31 | list_for_each_entry_rcu(group, &tomoyo_group_list[TOMOYO_PATH_GROUP], |
32 | list) { | ||
34 | if (saved_group_name != group->group_name) | 33 | if (saved_group_name != group->group_name) |
35 | continue; | 34 | continue; |
36 | atomic_inc(&group->users); | 35 | atomic_inc(&group->users); |
@@ -42,7 +41,8 @@ struct tomoyo_group *tomoyo_get_path_group(const char *group_name) | |||
42 | entry->group_name = saved_group_name; | 41 | entry->group_name = saved_group_name; |
43 | saved_group_name = NULL; | 42 | saved_group_name = NULL; |
44 | atomic_set(&entry->users, 1); | 43 | atomic_set(&entry->users, 1); |
45 | list_add_tail_rcu(&entry->list, &tomoyo_path_group_list); | 44 | list_add_tail_rcu(&entry->list, |
45 | &tomoyo_group_list[TOMOYO_PATH_GROUP]); | ||
46 | group = entry; | 46 | group = entry; |
47 | entry = NULL; | 47 | entry = NULL; |
48 | error = 0; | 48 | error = 0; |
@@ -107,7 +107,8 @@ bool tomoyo_read_path_group_policy(struct tomoyo_io_buffer *head) | |||
107 | { | 107 | { |
108 | struct list_head *gpos; | 108 | struct list_head *gpos; |
109 | struct list_head *mpos; | 109 | struct list_head *mpos; |
110 | list_for_each_cookie(gpos, head->read_var1, &tomoyo_path_group_list) { | 110 | list_for_each_cookie(gpos, head->read_var1, |
111 | &tomoyo_group_list[TOMOYO_PATH_GROUP]) { | ||
111 | struct tomoyo_group *group; | 112 | struct tomoyo_group *group; |
112 | group = list_entry(gpos, struct tomoyo_group, list); | 113 | group = list_entry(gpos, struct tomoyo_group, list); |
113 | list_for_each_cookie(mpos, head->read_var2, | 114 | list_for_each_cookie(mpos, head->read_var2, |