diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2011-09-25 04:50:23 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2011-09-25 20:46:20 -0400 |
commit | f9732ea145886786a6f8b0493bc2239e70cbacdb (patch) | |
tree | e29b2441cc916a174d7cd0b03cd18986ae545250 /security/tomoyo/common.h | |
parent | 778c4a4d60d932c1df6d270dcbc88365823c3963 (diff) |
TOMOYO: Simplify garbage collector.
When TOMOYO started using garbage collector at commit 847b173e "TOMOYO: Add
garbage collector.", we waited for close() before kfree(). Thus, elements to be
kfree()d were queued up using tomoyo_gc_list list.
But it turned out that tomoyo_element_linked_by_gc() tends to choke garbage
collector when certain pattern of entries are queued.
Since garbage collector is no longer waiting for close() since commit 2e503bbb
"TOMOYO: Fix lockdep warning.", we can remove tomoyo_gc_list list and
tomoyo_element_linked_by_gc() by doing sequential processing.
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/common.h')
-rw-r--r-- | security/tomoyo/common.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/security/tomoyo/common.h b/security/tomoyo/common.h index 1a19ad3e67ea..a0212fbf60fb 100644 --- a/security/tomoyo/common.h +++ b/security/tomoyo/common.h | |||
@@ -52,6 +52,9 @@ | |||
52 | 52 | ||
53 | #define TOMOYO_EXEC_TMPSIZE 4096 | 53 | #define TOMOYO_EXEC_TMPSIZE 4096 |
54 | 54 | ||
55 | /* Garbage collector is trying to kfree() this element. */ | ||
56 | #define TOMOYO_GC_IN_PROGRESS -1 | ||
57 | |||
55 | /* Profile number is an integer between 0 and 255. */ | 58 | /* Profile number is an integer between 0 and 255. */ |
56 | #define TOMOYO_MAX_PROFILES 256 | 59 | #define TOMOYO_MAX_PROFILES 256 |
57 | 60 | ||
@@ -398,7 +401,7 @@ enum tomoyo_pref_index { | |||
398 | /* Common header for holding ACL entries. */ | 401 | /* Common header for holding ACL entries. */ |
399 | struct tomoyo_acl_head { | 402 | struct tomoyo_acl_head { |
400 | struct list_head list; | 403 | struct list_head list; |
401 | bool is_deleted; | 404 | s8 is_deleted; /* true or false or TOMOYO_GC_IN_PROGRESS */ |
402 | } __packed; | 405 | } __packed; |
403 | 406 | ||
404 | /* Common header for shared entries. */ | 407 | /* Common header for shared entries. */ |
@@ -665,7 +668,7 @@ struct tomoyo_condition { | |||
665 | struct tomoyo_acl_info { | 668 | struct tomoyo_acl_info { |
666 | struct list_head list; | 669 | struct list_head list; |
667 | struct tomoyo_condition *cond; /* Maybe NULL. */ | 670 | struct tomoyo_condition *cond; /* Maybe NULL. */ |
668 | bool is_deleted; | 671 | s8 is_deleted; /* true or false or TOMOYO_GC_IN_PROGRESS */ |
669 | u8 type; /* One of values in "enum tomoyo_acl_entry_type_index". */ | 672 | u8 type; /* One of values in "enum tomoyo_acl_entry_type_index". */ |
670 | } __packed; | 673 | } __packed; |
671 | 674 | ||