diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-06-17 03:55:58 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:34:42 -0400 |
commit | 7c2ea22e3c5463627ca98924cd65cb9e480dc29c (patch) | |
tree | 3a105a08cf75c77689bdfe890c64f9ae433748b9 /security/tomoyo/gc.c | |
parent | 31845e8c6d3f4f26702e567c667277f9fd1f73a3 (diff) |
TOMOYO: Merge path_group and number_group.
Use common code for "path_group" and "number_group".
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 | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c index 414e18bd93c7..cf62a4ee79c2 100644 --- a/security/tomoyo/gc.c +++ b/security/tomoyo/gc.c | |||
@@ -266,33 +266,25 @@ static void tomoyo_collect_entry(void) | |||
266 | goto unlock; | 266 | goto unlock; |
267 | } | 267 | } |
268 | } | 268 | } |
269 | { | 269 | for (i = 0; i < TOMOYO_MAX_GROUP; i++) { |
270 | struct list_head *list = &tomoyo_group_list[i]; | ||
271 | int id; | ||
270 | struct tomoyo_group *group; | 272 | struct tomoyo_group *group; |
271 | list_for_each_entry_rcu(group, | 273 | switch (i) { |
272 | &tomoyo_group_list[TOMOYO_PATH_GROUP], | 274 | case 0: |
273 | list) { | 275 | id = TOMOYO_ID_PATH_GROUP; |
274 | tomoyo_collect_member(&group->member_list, | 276 | break; |
275 | TOMOYO_ID_PATH_GROUP); | 277 | default: |
276 | if (!list_empty(&group->member_list) || | 278 | id = TOMOYO_ID_NUMBER_GROUP; |
277 | atomic_read(&group->users)) | 279 | break; |
278 | continue; | ||
279 | if (!tomoyo_add_to_gc(TOMOYO_ID_GROUP, | ||
280 | &group->list)) | ||
281 | goto unlock; | ||
282 | } | 280 | } |
283 | } | 281 | list_for_each_entry(group, list, list) { |
284 | { | 282 | if (!tomoyo_collect_member(&group->member_list, id)) |
285 | struct tomoyo_group *group; | 283 | goto unlock; |
286 | list_for_each_entry_rcu(group, | ||
287 | &tomoyo_group_list[TOMOYO_NUMBER_GROUP], | ||
288 | list) { | ||
289 | tomoyo_collect_member(&group->member_list, | ||
290 | TOMOYO_ID_NUMBER_GROUP); | ||
291 | if (!list_empty(&group->member_list) || | 284 | if (!list_empty(&group->member_list) || |
292 | atomic_read(&group->users)) | 285 | atomic_read(&group->users)) |
293 | continue; | 286 | continue; |
294 | if (!tomoyo_add_to_gc(TOMOYO_ID_GROUP, | 287 | if (!tomoyo_add_to_gc(TOMOYO_ID_GROUP, &group->list)) |
295 | &group->list)) | ||
296 | goto unlock; | 288 | goto unlock; |
297 | } | 289 | } |
298 | } | 290 | } |