diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2010-05-16 21:08:05 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2010-08-02 01:33:36 -0400 |
commit | cb0abe6a5b58499bd4bc1403f4987af9ead0642c (patch) | |
tree | 3a48c36dcfe0cfe1e4b6f3faf5ca3e7fae4327c7 /security/tomoyo/common.c | |
parent | 4c3e9e2ded48bcf696a45945ea7d25bb15b873fd (diff) |
TOMOYO: Use structure for passing common arguments.
Use "struct tomoyo_request_info" instead of passing individual arguments.
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.c')
-rw-r--r-- | security/tomoyo/common.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/security/tomoyo/common.c b/security/tomoyo/common.c index d82c2978b1be..34d65871096c 100644 --- a/security/tomoyo/common.c +++ b/security/tomoyo/common.c | |||
@@ -985,21 +985,6 @@ static const char *tomoyo_get_exe(void) | |||
985 | } | 985 | } |
986 | 986 | ||
987 | /** | 987 | /** |
988 | * tomoyo_get_msg - Get warning message. | ||
989 | * | ||
990 | * @is_enforce: Is it enforcing mode? | ||
991 | * | ||
992 | * Returns "ERROR" or "WARNING". | ||
993 | */ | ||
994 | const char *tomoyo_get_msg(const bool is_enforce) | ||
995 | { | ||
996 | if (is_enforce) | ||
997 | return "ERROR"; | ||
998 | else | ||
999 | return "WARNING"; | ||
1000 | } | ||
1001 | |||
1002 | /** | ||
1003 | * tomoyo_check_flags - Check mode for specified functionality. | 988 | * tomoyo_check_flags - Check mode for specified functionality. |
1004 | * | 989 | * |
1005 | * @domain: Pointer to "struct tomoyo_domain_info". | 990 | * @domain: Pointer to "struct tomoyo_domain_info". |
@@ -1040,17 +1025,20 @@ bool tomoyo_verbose_mode(const struct tomoyo_domain_info *domain) | |||
1040 | /** | 1025 | /** |
1041 | * tomoyo_domain_quota_is_ok - Check for domain's quota. | 1026 | * tomoyo_domain_quota_is_ok - Check for domain's quota. |
1042 | * | 1027 | * |
1043 | * @domain: Pointer to "struct tomoyo_domain_info". | 1028 | * @r: Pointer to "struct tomoyo_request_info". |
1044 | * | 1029 | * |
1045 | * Returns true if the domain is not exceeded quota, false otherwise. | 1030 | * Returns true if the domain is not exceeded quota, false otherwise. |
1046 | * | 1031 | * |
1047 | * Caller holds tomoyo_read_lock(). | 1032 | * Caller holds tomoyo_read_lock(). |
1048 | */ | 1033 | */ |
1049 | bool tomoyo_domain_quota_is_ok(struct tomoyo_domain_info * const domain) | 1034 | bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r) |
1050 | { | 1035 | { |
1051 | unsigned int count = 0; | 1036 | unsigned int count = 0; |
1037 | struct tomoyo_domain_info *domain = r->domain; | ||
1052 | struct tomoyo_acl_info *ptr; | 1038 | struct tomoyo_acl_info *ptr; |
1053 | 1039 | ||
1040 | if (r->mode != TOMOYO_CONFIG_LEARNING) | ||
1041 | return false; | ||
1054 | if (!domain) | 1042 | if (!domain) |
1055 | return true; | 1043 | return true; |
1056 | list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { | 1044 | list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) { |