summaryrefslogtreecommitdiffstats
path: root/security/tomoyo/common.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-05-17 10:08:05 +0900
committerJames Morris <jmorris@namei.org>2010-08-02 15:33:36 +1000
commitcb0abe6a5b58499bd4bc1403f4987af9ead0642c (patch)
tree3a48c36dcfe0cfe1e4b6f3faf5ca3e7fae4327c7 /security/tomoyo/common.c
parent4c3e9e2ded48bcf696a45945ea7d25bb15b873fd (diff)
downloadlinux-cb0abe6a5b58499bd4bc1403f4987af9ead0642c.tar.bz2
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.c22
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)
}
/**
- * tomoyo_get_msg - Get warning message.
- *
- * @is_enforce: Is it enforcing mode?
- *
- * Returns "ERROR" or "WARNING".
- */
-const char *tomoyo_get_msg(const bool is_enforce)
-{
- if (is_enforce)
- return "ERROR";
- else
- return "WARNING";
-}
-
-/**
* tomoyo_check_flags - Check mode for specified functionality.
*
* @domain: Pointer to "struct tomoyo_domain_info".
@@ -1040,17 +1025,20 @@ bool tomoyo_verbose_mode(const struct tomoyo_domain_info *domain)
/**
* tomoyo_domain_quota_is_ok - Check for domain's quota.
*
- * @domain: Pointer to "struct tomoyo_domain_info".
+ * @r: Pointer to "struct tomoyo_request_info".
*
* Returns true if the domain is not exceeded quota, false otherwise.
*
* Caller holds tomoyo_read_lock().
*/
-bool tomoyo_domain_quota_is_ok(struct tomoyo_domain_info * const domain)
+bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r)
{
unsigned int count = 0;
+ struct tomoyo_domain_info *domain = r->domain;
struct tomoyo_acl_info *ptr;
+ if (r->mode != TOMOYO_CONFIG_LEARNING)
+ return false;
if (!domain)
return true;
list_for_each_entry_rcu(ptr, &domain->acl_info_list, list) {